Loading libs/sensorprivacy/SensorPrivacyManager.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -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); Loading libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -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); Loading services/sensorservice/SensorService.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
libs/sensorprivacy/SensorPrivacyManager.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading
libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
services/sensorservice/SensorService.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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; Loading