diff options
author | Clay Murphy <claym@google.com> | 2017-11-13 23:53:38 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-13 23:53:38 +0000 |
commit | 9a4762534c1ef21cc1d166716eca1a3dc4c770e1 (patch) | |
tree | 21a24b7e87037c9d9364de151db069551e798d8a /en/devices/architecture/hidl | |
parent | 6700a72c3945b934469746e0a7d040aea8abd9ff (diff) | |
parent | 04afcc4f4865ec1e526e8ff4493ea340247e94f3 (diff) | |
download | source.android.com-9a4762534c1ef21cc1d166716eca1a3dc4c770e1.tar.gz |
Merge "Docs: Changes to source.android.com"
Diffstat (limited to 'en/devices/architecture/hidl')
-rw-r--r-- | en/devices/architecture/hidl/services.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/en/devices/architecture/hidl/services.html b/en/devices/architecture/hidl/services.html index 647555b7..75933ec9 100644 --- a/en/devices/architecture/hidl/services.html +++ b/en/devices/architecture/hidl/services.html @@ -51,8 +51,12 @@ into the server.</p> version, calling <code>getService</code> on the desired HAL class:</p> <pre class="prettyprint"> +// C++ sp<V1_1::IFooService> service = V1_1::IFooService::getService(); sp<V1_1::IFooService> alternateService = 1_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 */); </pre> <p>Each version of a HIDL interface is treated as a separate interface. Thus, @@ -69,6 +73,16 @@ returned interface. For an interface <code>IFoo</code> in package <code>android.hardware.foo</code> in the device manifest if the entry exists; and if the transport method is not available, nullptr is returned.</p> +<p> In some cases, it may be necessary to continue immediately even without +getting the service. This can happen (for instance) when a client wants to +manage service notifications itself or in a diagnostic program (such as +<code>atrace</code>) which needs to get all hwservices and retrieve them. In +this case, additional APIs are provided such as <code>tryGetService</code> in C++ or +<code>getService("instance-name", false)</code> in Java. The legacy API +<code>getService</code> provided in Java also must be used with service +notifications. Using this API does not avoid the race condition where a server +registers itself after the client requests it with one of these no-retry APIs.</p> + <h2 id=death>Service death notifications</h2> <p>Clients who want to be notified when a service dies can receive death notifications delivered by the framework. To receive notifications, the client |