summaryrefslogtreecommitdiff
path: root/libs/sensorprivacy/SensorPrivacyManager.cpp
diff options
context:
space:
mode:
authorMichael Groover <mpgroover@google.com>2019-01-03 21:12:02 -0800
committerMichael Groover <mpgroover@google.com>2019-01-03 21:32:35 -0800
commit56d630210e81ba443a0ba3841c487b3232eb2ce8 (patch)
treeab4abf1273994998323f68bbc530cca0dcec871d /libs/sensorprivacy/SensorPrivacyManager.cpp
parent5619c84f8f0ec406b1f334d57b51e06caef37f96 (diff)
Add DeathRecipient notification to SensorPrivacyManager
Bug: 110842805 Test: Manually verified SensorPrivacyPolicy was notified when \ system_server was killed. Change-Id: I030d081a9e5d1b309b5449cb0ba900ecfd49f54a
Diffstat (limited to 'libs/sensorprivacy/SensorPrivacyManager.cpp')
-rw-r--r--libs/sensorprivacy/SensorPrivacyManager.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/sensorprivacy/SensorPrivacyManager.cpp b/libs/sensorprivacy/SensorPrivacyManager.cpp
index 1da79a0c8e..f973cbad17 100644
--- a/libs/sensorprivacy/SensorPrivacyManager.cpp
+++ b/libs/sensorprivacy/SensorPrivacyManager.cpp
@@ -85,4 +85,22 @@ bool SensorPrivacyManager::isSensorPrivacyEnabled()
return false;
}
+status_t SensorPrivacyManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient)
+{
+ sp<hardware::ISensorPrivacyManager> service = getService();
+ if (service != nullptr) {
+ return IInterface::asBinder(service)->linkToDeath(recipient);
+ }
+ return INVALID_OPERATION;
+}
+
+status_t SensorPrivacyManager::unlinkToDeath(const sp<IBinder::DeathRecipient>& recipient)
+{
+ sp<hardware::ISensorPrivacyManager> service = getService();
+ if (service != nullptr) {
+ return IInterface::asBinder(service)->unlinkToDeath(recipient);
+ }
+ return INVALID_OPERATION;
+}
+
}; // namespace android