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

Commit 754eaf88 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add aidl method for removing individual sensor privacy listener" into...

Merge "Add aidl method for removing individual sensor privacy listener" into sc-dev am: 9d941428 am: 6cf3ee7f am: 9697b2e9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14651394

Change-Id: I217975edb5cd5636c8c0bdd7c0bee031b49ad7dc
parents 4bd5706c 9697b2e9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -100,6 +100,15 @@ void SensorPrivacyManager::removeSensorPrivacyListener(
    }
}

void SensorPrivacyManager::removeIndividualSensorPrivacyListener(int sensor,
        const sp<hardware::ISensorPrivacyListener>& listener)
{
    sp<hardware::ISensorPrivacyManager> service = getService();
    if (service != nullptr) {
        service->removeIndividualSensorPrivacyListener(sensor, listener);
    }
}

bool SensorPrivacyManager::isSensorPrivacyEnabled()
{
    sp<hardware::ISensorPrivacyManager> service = getService();
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ interface ISensorPrivacyManager {

    void removeSensorPrivacyListener(in ISensorPrivacyListener listener);

    void removeIndividualSensorPrivacyListener(int sensor, in ISensorPrivacyListener listener);

    boolean isSensorPrivacyEnabled();

    boolean isIndividualSensorPrivacyEnabled(int userId, int sensor);
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ public:
    status_t addIndividualSensorPrivacyListener(int userId, int sensor,
            const sp<hardware::ISensorPrivacyListener>& listener);
    void removeSensorPrivacyListener(const sp<hardware::ISensorPrivacyListener>& listener);
    void removeIndividualSensorPrivacyListener(int sensor,
            const sp<hardware::ISensorPrivacyListener>& listener);
    bool isSensorPrivacyEnabled();
    bool isIndividualSensorPrivacyEnabled(int userId, int sensor);
    status_t isIndividualSensorPrivacyEnabled(int userId, int sensor, bool &result);
+6 −1
Original line number Diff line number Diff line
@@ -2138,8 +2138,13 @@ void SensorService::SensorPrivacyPolicy::registerSelf() {
void SensorService::SensorPrivacyPolicy::unregisterSelf() {
    AutoCallerClear acc;
    SensorPrivacyManager spm;
    if (mIsIndividualMic) {
        spm.removeIndividualSensorPrivacyListener(
                SensorPrivacyManager::INDIVIDUAL_SENSOR_MICROPHONE, this);
    } else {
        spm.removeSensorPrivacyListener(this);
    }
}

bool SensorService::SensorPrivacyPolicy::isSensorPrivacyEnabled() {
    return mSensorPrivacyEnabled;