summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-03-25 23:46:01 +0000
committer Steven Moreland <smoreland@google.com> 2021-03-26 01:02:01 +0000
commit21ef24df732e984694097f9174ce44ea968f7d3a (patch)
tree3e851af4ec4c0735fc5c4e1da54d49faf639594e /libs
parent4e83ba78f1548a4ddd27797333d3d484bd798e76 (diff)
libbinder_ndk: document #apex service caveats
Code in an APEX may be run in the same process as a platform code and have permissions to get any service. While this is targetted to be fixed in b/139325195, it should be documented for now. When these services are used from within the VNDK, binder's vendor stability mechanism prevents misuse of this API, except inside of the product partition APEX. This is tracked in b/182526613. However, it is not called out here because due to their nature, these libraries aren't expected to register services or have dependencies on vendor. Bug: 181551684 Test: N/A Change-Id: I0ee551b731821fb114905e5f83fc7f81ef8cd395
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/ndk/include_platform/android/binder_manager.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/binder/ndk/include_platform/android/binder_manager.h b/libs/binder/ndk/include_platform/android/binder_manager.h
index 5df0012bd3..0668472240 100644
--- a/libs/binder/ndk/include_platform/android/binder_manager.h
+++ b/libs/binder/ndk/include_platform/android/binder_manager.h
@@ -26,6 +26,9 @@ __BEGIN_DECLS
* This registers the service with the default service manager under this instance name. This does
* not take ownership of binder.
*
+ * WARNING: when using this API across an APEX boundary, it should only be used with stable
+ * AIDL services. TODO(b/139325195)
+ *
* \param binder object to register globally with the service manager.
* \param instance identifier of the service. This will be used to lookup the service.
*
@@ -39,6 +42,9 @@ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServic
* service is not available This also implicitly calls AIBinder_incStrong (so the caller of this
* function is responsible for calling AIBinder_decStrong).
*
+ * WARNING: when using this API across an APEX boundary, it should only be used with stable
+ * AIDL services. TODO(b/139325195)
+ *
* \param instance identifier of the service used to lookup the service.
*/
__attribute__((warn_unused_result)) AIBinder* AServiceManager_checkService(const char* instance);
@@ -48,6 +54,9 @@ __attribute__((warn_unused_result)) AIBinder* AServiceManager_checkService(const
* it. This also implicitly calls AIBinder_incStrong (so the caller of this function is responsible
* for calling AIBinder_decStrong).
*
+ * WARNING: when using this API across an APEX boundary, it should only be used with stable
+ * AIDL services. TODO(b/139325195)
+ *
* \param instance identifier of the service used to lookup the service.
*/
__attribute__((warn_unused_result)) AIBinder* AServiceManager_getService(const char* instance);
@@ -78,6 +87,9 @@ binder_status_t AServiceManager_registerLazyService(AIBinder* binder, const char
* This also implicitly calls AIBinder_incStrong (so the caller of this function is responsible
* for calling AIBinder_decStrong).
*
+ * WARNING: when using this API across an APEX boundary, it should only be used with stable
+ * AIDL services. TODO(b/139325195)
+ *
* \param instance identifier of the service used to lookup the service.
*
* \return service if registered, null if not.