summaryrefslogtreecommitdiff
path: root/libs/binder/ActivityManager.cpp
diff options
context:
space:
mode:
author Eino-Ville Talvala <etalvala@google.com> 2018-03-20 11:05:23 -0700
committer Eino-Ville Talvala <etalvala@google.com> 2018-03-20 11:05:23 -0700
commitae8b20d8174633510cded34beb0fda51bdc1f974 (patch)
treecfcf93c13146046843fa7bc2cd31fdbbc118c1ee /libs/binder/ActivityManager.cpp
parent43bfc23bb8c920ad4a97466e363ae94538e53805 (diff)
ActivityManager: Add link/unlinkToDeath
Native services aren't killed when the system service dies, so they may need to be able to tell when ActivityManager has died. Test: adb shell stop; adb shell start; verify camera service still allows camera use. No regression to camera CTS. Bug: 74230547 Change-Id: Iaa078b2f9a1d9c7be305b7667e3055a8ce52aa21
Diffstat (limited to 'libs/binder/ActivityManager.cpp')
-rw-r--r--libs/binder/ActivityManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/binder/ActivityManager.cpp b/libs/binder/ActivityManager.cpp
index e1cc5da2e9..9adac26a31 100644
--- a/libs/binder/ActivityManager.cpp
+++ b/libs/binder/ActivityManager.cpp
@@ -80,4 +80,20 @@ void ActivityManager::unregisterUidObserver(const sp<IUidObserver>& observer)
}
}
+status_t ActivityManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient) {
+ sp<IActivityManager> service = getService();
+ if (service != NULL) {
+ return IInterface::asBinder(service)->linkToDeath(recipient);
+ }
+ return INVALID_OPERATION;
+}
+
+status_t ActivityManager::unlinkToDeath(const sp<IBinder::DeathRecipient>& recipient) {
+ sp<IActivityManager> service = getService();
+ if (service != NULL) {
+ return IInterface::asBinder(service)->unlinkToDeath(recipient);
+ }
+ return INVALID_OPERATION;
+}
+
}; // namespace android