IServiceManager: @nullable IBinder
These binders are expected to be null (for getService/checkService),
however '@nullable' only affects the C++/NDK aidl backends, and these
APIs are only used in libbinder IServiceManager.cpp. This wasn't noticed
since error is collapsed into nullptr for most APIs. However, in
waitForService, this broke things, since it was expecting error only
when there is a real error.
Fixes: 144534032
Test: boot and check waitForService works appropriately when service
starts too late. Up until now, surprisingly, users of this function
have all been lucky or haven't noticed an issue.
Change-Id: I138c9916253d56a0dcf7dd02b8bf46e84a3c7a33
diff --git a/libs/binder/aidl/android/os/IServiceManager.aidl b/libs/binder/aidl/android/os/IServiceManager.aidl
index 8c7ebba..b965881 100644
--- a/libs/binder/aidl/android/os/IServiceManager.aidl
+++ b/libs/binder/aidl/android/os/IServiceManager.aidl
@@ -58,7 +58,7 @@
* Returns null if the service does not exist.
*/
@UnsupportedAppUsage
- IBinder getService(@utf8InCpp String name);
+ @nullable IBinder getService(@utf8InCpp String name);
/**
* Retrieve an existing service called @a name from the service
@@ -66,7 +66,7 @@
* exist.
*/
@UnsupportedAppUsage
- IBinder checkService(@utf8InCpp String name);
+ @nullable IBinder checkService(@utf8InCpp String name);
/**
* Place a new @a service called @a name into the service