From e0c4fe2afbc1554369bc51d0005f744b6972b3e9 Mon Sep 17 00:00:00 2001 From: Android Partner Docs Date: Tue, 24 Jul 2018 13:05:33 -0700 Subject: Docs: Changes to source.android.com - 205877786 Update June bulletin with CVE-2018-5383 as part of coordi... by Android Partner Docs - 205847026 Clarify HIDL threading documentation. by Android Partner Docs - 205846637 Devsite localized content from translation request 956021. by Android Partner Docs - 205701835 Add comma by Christina Nguyen - 205701208 avoid awkward "lunch stack" both in code font, despite be... by Android Partner Docs - 205679165 Devsite localized content from translation request 949264. by Android Partner Docs - 205679151 Devsite localized content from translation request 955351. by Android Partner Docs - 205679132 Devsite localized content from translation request 950024. by Android Partner Docs - 205450243 Devsite localized content from translation request 944916. by Android Partner Docs - 205178437 Add news item for Android Settings Design Guidelines page by Kenneth Lau - 205166332 Add local DAC versions file to fix sync by Clay Murphy - 205166087 Removing symlink by Clay Murphy - 205162476 Automated g4 rollback of changelist 205029236. by Clay Murphy - 205104451 Update CTS/CTS-Verifier downloads for CTS-July-2018 Relea... by Android Partner Docs - 205102152 Devsite localized content from translation request 950737. by Android Partner Docs - 205102143 Devsite localized content from translation request 953991. by Android Partner Docs - 205102094 Devsite localized content from translation request 947433. by Android Partner Docs - 205102083 Devsite localized content from translation request 954738. by Android Partner Docs - 205102070 Devsite localized content from translation request 954739. by Android Partner Docs - 205093268 Add Android Settings Design Guidelines by Kenneth Lau - 205029236 Trying absolute path to allow syncs to succeed by Clay Murphy - 204938662 Remove redundant "latency" from filenames by Kenneth Lau - 204933910 Fix from KEY_RADIO to KEY_RIGHT per SAC feedback by Heidi von Markham - 204922939 Devsite localized content from translation request 941015. by Android Partner Docs - 204922923 Devsite localized content from translation request 950028. by Android Partner Docs - 204801837 Publish localized bulletins by Danielle Roberts - 204760484 Devsite localized content from translation request 952104. by Android Partner Docs - 204760460 Devsite localized content from translation request 950741. by Android Partner Docs - 204526272 Clarify oneway scheduling implications in HIDL documentat... by Android Partner Docs - 204524681 Devsite localized content from translation request 949268. by Android Partner Docs - 204520207 Automated g4 rollback of changelist 204513684. by Clay Murphy - 204513684 Automated g4 rollback of changelist 204504772. by Kenneth Lau - 204504772 Move audio latency files to subdirectory by Kenneth Lau - 204482211 Devsite localized content from translation request 944149. by Android Partner Docs - 204332070 Devsite localized content from translation request 950023. by Android Partner Docs - 204245788 Remove CVE-2017-5754 from 2018-05-05 SPL by Android Partner Docs - 204219228 Remove Shannon from localization file by Danielle Roberts - 204216756 Fix formatting error.
 tag not closed correctly, cau... by Mark Hecomovich 
  - 204212862 Devsite localized content from translation request 947432. by Android Partner Docs 
  - 204212845 Devsite localized content from translation request 944148. by Android Partner Docs 
  - 204212833 Devsite localized content from translation request 951310. by Android Partner Docs 
  - 204194863 CVE-2018-5855 and CVE-2018-11258 has been removed from th... by Android Partner Docs 
  - 204040903 update patch link for CVE-2018-9415 by Android Partner Docs 
  - 203993808 Devsite localized content from translation request 950027. by Android Partner Docs 
  - 203987557 Devsite localized content from translation request 947629. by Android Partner Docs 
  - 203850681 Update Java getService documentation: by Android Partner Docs 
  - 203850483 Clarify Java same process communication for clients/serve... by Android Partner Docs 
  - 203794044 Add Aparna, remove Sharon. by Christina Nguyen 
  - 203783131 Devsite localized content from translation request 949265. by Android Partner Docs 
  - 203783124 Devsite localized content from translation request 946899. by Android Partner Docs 
  - 203783073 Devsite localized content from translation request 932856. by Android Partner Docs 
  - 203783060 Devsite localized content from translation request 932854. by Android Partner Docs 
  - 203783043 Devsite localized content from translation request 949270. by Android Partner Docs 
  - 203601964 Devsite localized content from translation request 940579. by Android Partner Docs 
  - 203331948 Devsite localized content from translation request 949266. by Android Partner Docs 
  - 203202185 Announce July bulletins on home page by Danielle Roberts 
  - 203187053 Add AOSP links to July bulletins by Danielle Roberts 
  - 203178784 Adding a _versions.html files so that we can use variable... by Gina Dimino 
  - 203171121 Add link to developer docs for the same feature by Clay Murphy 
  - 203140116 Devsite localized content from translation request 946902. by Android Partner Docs 
  - 203140085 Devsite localized content from translation request 944578. by Android Partner Docs 
  - 203140072 Devsite localized content from translation request 946901. by Android Partner Docs 

PiperOrigin-RevId: 205877786
Change-Id: Ie3a2b46276c092b614e91a4c5883b029c224b58d
---
 en/devices/architecture/hidl-java/index.html | 12 ++++++++----
 en/devices/architecture/hidl/services.html   |  4 ++--
 en/devices/architecture/hidl/threading.html  | 24 ++++++++++++++++++------
 3 files changed, 28 insertions(+), 12 deletions(-)

(limited to 'en/devices/architecture')

diff --git a/en/devices/architecture/hidl-java/index.html b/en/devices/architecture/hidl-java/index.html
index c4218160..45eefc7d 100644
--- a/en/devices/architecture/hidl-java/index.html
+++ b/en/devices/architecture/hidl-java/index.html
@@ -68,8 +68,9 @@ The static version of the library is also available as
 
 import android.hardware.foo.V1_0.IFoo;
 ...
-IFoo server = IFoo.getService(); // throws exception if not available
-IFoo anotherServer = IFoo.getService("second_impl");
+// retry to wait until the service starts up if it is in the manifest
+IFoo server = IFoo.getService(true /* retry */); // throws NoSuchElementException if not available
+IFoo anotherServer = IFoo.getService("second_impl", true /* retry */);
 server.doSomething(…);
 
@@ -82,6 +83,9 @@ callbacks from HALs.

Warning: Do not implement a driver (HAL) in Java. We strongly recommend you implement drivers in C++.

+

Warning: Java drivers must be in a separate +process from their clients (same process communication is not supported).

+

For interface IFooCallback in version 1.0 of package android.hardware.foo, you can implement your interface in Java using the following steps:

@@ -142,7 +146,7 @@ class FooCallback extends IFooCallback.Stub { .... // Get the service you will be receiving callbacks from. // This also starts the threadpool for your callback service. -IFoo server = IFoo.getService(); // throws exception if not available +IFoo server = IFoo.getService(true /* retry */); // throws NoSuchElementException if not available .... // This must be a persistent instance variable, not local, // to avoid premature garbage collection. @@ -173,7 +177,7 @@ interface IBetterFoo extends IFoo { extended interface:

-IFoo baseService = Foo.getService();
+IFoo baseService = IFoo.getService(true /* retry */); // throws NoSuchElementException if not available
 IBetterFoo extendedService = IBetterFoo.castFrom(baseService);
 if (extendedService != null) {
   // The service implements the extended interface.
diff --git a/en/devices/architecture/hidl/services.html b/en/devices/architecture/hidl/services.html
index 805bc800..1d2deccb 100644
--- a/en/devices/architecture/hidl/services.html
+++ b/en/devices/architecture/hidl/services.html
@@ -53,10 +53,10 @@ version, calling getService on the desired HAL class:

 // C++
 sp<V1_1::IFooService> service = V1_1::IFooService::getService();
-sp<V1_1::IFooService> alternateService = 1_1::IFooService::getService("another_foo_service");
+sp<V1_1::IFooService> alternateService = V1_1::IFooService::getService("another_foo_service");
 // Java
 V1_1.IFooService; service = V1_1.IFooService.getService(true /* retry */);
-V1_1.IFooService; alternateService = 1_1.IFooService.getService("another", true /* retry */);
+V1_1.IFooService; alternateService = V1_1.IFooService.getService("another", true /* retry */);
 

Each version of a HIDL interface is treated as a separate interface. Thus, diff --git a/en/devices/architecture/hidl/threading.html b/en/devices/architecture/hidl/threading.html index 5b8fa038..26c2cc12 100644 --- a/en/devices/architecture/hidl/threading.html +++ b/en/devices/architecture/hidl/threading.html @@ -48,11 +48,11 @@ available, it blocks until one is available.

If the server has only one thread, then calls into the server are completed in order. A server with more than one thread may complete calls out of order -even if the client has only one thread. As oneway calls do not -block the client, multiple oneway calls may be processed -simultaneously or out of order by a server with more than one thread, and -oneway calls may be processed concurrently with a subsequent -blocking call.

+even if the client has only one thread. However, for a given interface object, +oneway calls are guaranteed to be ordered (see +Server threading model). For a multi-threaded server that +hosts multiple interfaces, oneway calls to different interfaces +may be processed concurrently with each other or other blocking calls.

Multiple nested calls will be sent on the same hwbinder thread. For instance, if a process (A) makes a synchronous call from a hwbinder thread into process (B), @@ -160,7 +160,19 @@ server returns a Return<void> object.

Oneway calls

When a function is marked oneway, the client returns immediately -and does not wait for the server to complete its function call invocation.

+and does not wait for the server to complete its function call invocation. At the +surface (and in aggregate), this means the function call takes half the +time because it is executing half the code, but when writing implementations that +are performance sensitive, this has some scheduling implications. Normally, +using a oneway call causes the callee to continue to be scheduled whereas +using a normal synchronous call causes the scheduler to immediately transfer +from the callee to the caller process. This is a performance optimization in +binder. For services where the oneway call must be executed in the target process +with a high priority, the scheduling policy of the receiving service can be +changed. In C++, using libhidltransport's method +setMinSchedulerPolicy with the scheduler priorities and policies +defined in sched.h ensures that all calls into the service run at +least at the set scheduling policy and priority.

-- cgit v1.2.3