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

Commit a9fe8c6e authored by Michael Groover's avatar Michael Groover Committed by Android (Google) Code Review
Browse files

Merge "Add DeathRecipient notification to SensorPrivacyManager"

parents 31d7a9c2 56d63021
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ public:
    void removeSensorPrivacyListener(const sp<hardware::ISensorPrivacyListener>& listener);
    bool isSensorPrivacyEnabled();

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

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