aboutsummaryrefslogtreecommitdiff
path: root/en/devices/architecture
diff options
context:
space:
mode:
authorAndroid Partner Docs <noreply@android.com>2018-07-24 13:05:33 -0700
committerClay Murphy <claym@google.com>2018-07-24 15:52:53 -0700
commite0c4fe2afbc1554369bc51d0005f744b6972b3e9 (patch)
tree2f20099c5af787c7d17669fd5aa01a6942a65f7b /en/devices/architecture
parent78f05f73fea8658e61b8de6e886f435071d2db8b (diff)
downloadsource.android.com-e0c4fe2afbc1554369bc51d0005f744b6972b3e9.tar.gz
Docs: Changes to source.android.com
- 205877786 Update June bulletin with CVE-2018-5383 as part of coordi... by Android Partner Docs <noreply@android.com> - 205847026 Clarify HIDL threading documentation. by Android Partner Docs <noreply@android.com> - 205846637 Devsite localized content from translation request 956021. by Android Partner Docs <noreply@android.com> - 205701835 Add comma by Christina Nguyen <cqn@google.com> - 205701208 avoid awkward "lunch stack" both in code font, despite be... by Android Partner Docs <noreply@android.com> - 205679165 Devsite localized content from translation request 949264. by Android Partner Docs <noreply@android.com> - 205679151 Devsite localized content from translation request 955351. by Android Partner Docs <noreply@android.com> - 205679132 Devsite localized content from translation request 950024. by Android Partner Docs <noreply@android.com> - 205450243 Devsite localized content from translation request 944916. by Android Partner Docs <noreply@android.com> - 205178437 Add news item for Android Settings Design Guidelines page by Kenneth Lau <kennethlau@google.com> - 205166332 Add local DAC versions file to fix sync by Clay Murphy <claym@google.com> - 205166087 Removing symlink by Clay Murphy <claym@google.com> - 205162476 Automated g4 rollback of changelist 205029236. by Clay Murphy <claym@google.com> - 205104451 Update CTS/CTS-Verifier downloads for CTS-July-2018 Relea... by Android Partner Docs <noreply@android.com> - 205102152 Devsite localized content from translation request 950737. by Android Partner Docs <noreply@android.com> - 205102143 Devsite localized content from translation request 953991. by Android Partner Docs <noreply@android.com> - 205102094 Devsite localized content from translation request 947433. by Android Partner Docs <noreply@android.com> - 205102083 Devsite localized content from translation request 954738. by Android Partner Docs <noreply@android.com> - 205102070 Devsite localized content from translation request 954739. by Android Partner Docs <noreply@android.com> - 205093268 Add Android Settings Design Guidelines by Kenneth Lau <kennethlau@google.com> - 205029236 Trying absolute path to allow syncs to succeed by Clay Murphy <claym@google.com> - 204938662 Remove redundant "latency" from filenames by Kenneth Lau <kennethlau@google.com> - 204933910 Fix from KEY_RADIO to KEY_RIGHT per SAC feedback by Heidi von Markham <hvm@google.com> - 204922939 Devsite localized content from translation request 941015. by Android Partner Docs <noreply@android.com> - 204922923 Devsite localized content from translation request 950028. by Android Partner Docs <noreply@android.com> - 204801837 Publish localized bulletins by Danielle Roberts <daroberts@google.com> - 204760484 Devsite localized content from translation request 952104. by Android Partner Docs <noreply@android.com> - 204760460 Devsite localized content from translation request 950741. by Android Partner Docs <noreply@android.com> - 204526272 Clarify oneway scheduling implications in HIDL documentat... by Android Partner Docs <noreply@android.com> - 204524681 Devsite localized content from translation request 949268. by Android Partner Docs <noreply@android.com> - 204520207 Automated g4 rollback of changelist 204513684. by Clay Murphy <claym@google.com> - 204513684 Automated g4 rollback of changelist 204504772. by Kenneth Lau <kennethlau@google.com> - 204504772 Move audio latency files to subdirectory by Kenneth Lau <kennethlau@google.com> - 204482211 Devsite localized content from translation request 944149. by Android Partner Docs <noreply@android.com> - 204332070 Devsite localized content from translation request 950023. by Android Partner Docs <noreply@android.com> - 204245788 Remove CVE-2017-5754 from 2018-05-05 SPL by Android Partner Docs <noreply@android.com> - 204219228 Remove Shannon from localization file by Danielle Roberts <daroberts@google.com> - 204216756 Fix formatting error. <pre> tag not closed correctly, cau... by Mark Hecomovich <mheco@google.com> - 204212862 Devsite localized content from translation request 947432. by Android Partner Docs <noreply@android.com> - 204212845 Devsite localized content from translation request 944148. by Android Partner Docs <noreply@android.com> - 204212833 Devsite localized content from translation request 951310. by Android Partner Docs <noreply@android.com> - 204194863 CVE-2018-5855 and CVE-2018-11258 has been removed from th... by Android Partner Docs <noreply@android.com> - 204040903 update patch link for CVE-2018-9415 by Android Partner Docs <noreply@android.com> - 203993808 Devsite localized content from translation request 950027. by Android Partner Docs <noreply@android.com> - 203987557 Devsite localized content from translation request 947629. by Android Partner Docs <noreply@android.com> - 203850681 Update Java getService documentation: by Android Partner Docs <noreply@android.com> - 203850483 Clarify Java same process communication for clients/serve... by Android Partner Docs <noreply@android.com> - 203794044 Add Aparna, remove Sharon. by Christina Nguyen <cqn@google.com> - 203783131 Devsite localized content from translation request 949265. by Android Partner Docs <noreply@android.com> - 203783124 Devsite localized content from translation request 946899. by Android Partner Docs <noreply@android.com> - 203783073 Devsite localized content from translation request 932856. by Android Partner Docs <noreply@android.com> - 203783060 Devsite localized content from translation request 932854. by Android Partner Docs <noreply@android.com> - 203783043 Devsite localized content from translation request 949270. by Android Partner Docs <noreply@android.com> - 203601964 Devsite localized content from translation request 940579. by Android Partner Docs <noreply@android.com> - 203331948 Devsite localized content from translation request 949266. by Android Partner Docs <noreply@android.com> - 203202185 Announce July bulletins on home page by Danielle Roberts <daroberts@google.com> - 203187053 Add AOSP links to July bulletins by Danielle Roberts <daroberts@google.com> - 203178784 Adding a _versions.html files so that we can use variable... by Gina Dimino <gdimino@google.com> - 203171121 Add link to developer docs for the same feature by Clay Murphy <claym@google.com> - 203140116 Devsite localized content from translation request 946902. by Android Partner Docs <noreply@android.com> - 203140085 Devsite localized content from translation request 944578. by Android Partner Docs <noreply@android.com> - 203140072 Devsite localized content from translation request 946901. by Android Partner Docs <noreply@android.com> PiperOrigin-RevId: 205877786 Change-Id: Ie3a2b46276c092b614e91a4c5883b029c224b58d
Diffstat (limited to 'en/devices/architecture')
-rw-r--r--en/devices/architecture/hidl-java/index.html12
-rw-r--r--en/devices/architecture/hidl/services.html4
-rw-r--r--en/devices/architecture/hidl/threading.html24
3 files changed, 28 insertions, 12 deletions
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
<pre class="prettyprint">
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(&hellip;);
</pre>
</li>
@@ -82,6 +83,9 @@ callbacks from HALs.</p>
<p class=warning><strong>Warning</strong>: Do not implement a driver (HAL) in
Java. We strongly recommend you implement drivers in C++.</p>
+<p class=warning><strong>Warning</strong>: Java drivers must be in a separate
+process from their clients (same process communication is not supported).</p>
+
<p>For interface <code>IFooCallback</code> in version 1.0 of package
<code>android.hardware.foo</code>, you can implement your interface in Java
using the following steps:</p>
@@ -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:</p>
<pre class="prettyprint">
-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 <code>getService</code> on the desired HAL class:</p>
<pre class="prettyprint">
// C++
sp&lt;V1_1::IFooService&gt; service = V1_1::IFooService::getService();
-sp&lt;V1_1::IFooService&gt; alternateService = 1_1::IFooService::getService("another_foo_service");
+sp&lt;V1_1::IFooService&gt; 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 */);
</pre>
<p>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.</p>
<p>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 <code>oneway</code> calls do not
-block the client, multiple <code>oneway</code> calls may be processed
-simultaneously or out of order by a server with more than one thread, and
-<code>oneway</code> calls may be processed concurrently with a subsequent
-blocking call.</p>
+even if the client has only one thread. However, for a given interface object,
+<code>oneway</code> calls are guaranteed to be ordered (see
+<a href="#model">Server threading model</a>). For a multi-threaded server that
+hosts multiple interfaces, <code>oneway</code> calls to different interfaces
+may be processed concurrently with each other or other blocking calls.</p>
<p>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 <code>Return&lt;void&gt;</code> object.</p>
<h3 id=oneway>Oneway calls</h3>
<p>When a function is marked <code>oneway</code>, the client returns immediately
-and does not wait for the server to complete its function call invocation.</p>
+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 <code>libhidltransport</code>'s method
+<code>setMinSchedulerPolicy</code> with the scheduler priorities and policies
+defined in <code>sched.h</code> ensures that all calls into the service run at
+least at the set scheduling policy and priority.</p>
</body>
</html>