summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2021-05-14 03:49:28 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-05-14 03:49:28 +0000
commit8d009a7e1aaa30a147ba9bf6b146ed509669508e (patch)
tree06baa86d393876a811d2661c033983022cbf98f5 /libs
parentf7ec786037a2045878ddce50a92a45a38f2b554a (diff)
parente6915d55406c4938b3e44fd3a6b8f7bf67d53204 (diff)
Merge "libbinder: more forcePersist docs" am: e6915d5540
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1707787 Change-Id: I4ddb9ef35ce7de45400201659859671ffbdb7ada
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/include/binder/LazyServiceRegistrar.h8
-rw-r--r--libs/binder/ndk/include_platform/android/binder_manager.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/libs/binder/include/binder/LazyServiceRegistrar.h b/libs/binder/include/binder/LazyServiceRegistrar.h
index 96597320f6..f3ba830923 100644
--- a/libs/binder/include/binder/LazyServiceRegistrar.h
+++ b/libs/binder/include/binder/LazyServiceRegistrar.h
@@ -50,8 +50,12 @@ class LazyServiceRegistrar {
int dumpFlags = IServiceManager::DUMP_FLAG_PRIORITY_DEFAULT);
/**
* Force the service to persist, even when it has 0 clients.
- * If setting this flag from the server side, make sure to do so before calling registerService,
- * or there may be a race with the default dynamic shutdown.
+ * If setting this flag from the server side, make sure to do so before calling
+ * registerService, or there may be a race with the default dynamic shutdown.
+ *
+ * This should only be used if it is every eventually set to false. If a
+ * service needs to persist but doesn't need to dynamically shut down,
+ * prefer to control it with another mechanism such as ctl.start.
*/
void forcePersist(bool persist);
diff --git a/libs/binder/ndk/include_platform/android/binder_manager.h b/libs/binder/ndk/include_platform/android/binder_manager.h
index c610927164..2a66941cef 100644
--- a/libs/binder/ndk/include_platform/android/binder_manager.h
+++ b/libs/binder/ndk/include_platform/android/binder_manager.h
@@ -137,6 +137,10 @@ bool AServiceManager_isUpdatableViaApex(const char* instance) __INTRODUCED_IN(31
/**
* Prevent lazy services without client from shutting down their process
*
+ * This should only be used if it is every eventually set to false. If a
+ * service needs to persist but doesn't need to dynamically shut down,
+ * prefer to control it with another mechanism.
+ *
* \param persist 'true' if the process should not exit.
*/
void AServiceManager_forceLazyServicesPersist(bool persist) __INTRODUCED_IN(31);