Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56d63021 authored by Michael Groover's avatar Michael Groover
Browse files

Add DeathRecipient notification to SensorPrivacyManager

Bug: 110842805
Test: Manually verified SensorPrivacyPolicy was notified when \
      system_server was killed.

Change-Id: I030d081a9e5d1b309b5449cb0ba900ecfd49f54a
parent 5619c84f
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -85,4 +85,22 @@ bool SensorPrivacyManager::isSensorPrivacyEnabled()
    return false;
    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
}; // namespace android
+3 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,9 @@ public:
    void removeSensorPrivacyListener(const sp<hardware::ISensorPrivacyListener>& listener);
    void removeSensorPrivacyListener(const sp<hardware::ISensorPrivacyListener>& listener);
    bool isSensorPrivacyEnabled();
    bool isSensorPrivacyEnabled();


    status_t linkToDeath(const sp<IBinder::DeathRecipient>& recipient);
    status_t unlinkToDeath(const sp<IBinder::DeathRecipient>& recipient);

private:
private:
    Mutex mLock;
    Mutex mLock;
    sp<hardware::ISensorPrivacyManager> mService;
    sp<hardware::ISensorPrivacyManager> mService;