Update audiopolicy service to use new sensor privacy api
The new calls no longer require user ids since that is managed
internally in the sensor privacy service and calling services will
receive updates when the state is changed or user is changed who has a
different setting. Calling services should treat the state as a global
setting.
AudioPolicyService doesn't read the state of the microphone toggle
directly so this change shouldn't have any affect.
Test: Build
Bug: 191745272
Change-Id: Ied82f1e91da76706c6522424b7ff273c9a23754f
diff --git a/services/audiopolicy/service/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index 8add137..be90bf6 100644
--- a/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -1481,14 +1481,6 @@
spm.addSensorPrivacyListener(this);
}
-void AudioPolicyService::SensorPrivacyPolicy::registerSelfForMicrophoneOnly(int userId) {
- SensorPrivacyManager spm;
- mSensorPrivacyEnabled = spm.isIndividualSensorPrivacyEnabled(userId,
- SensorPrivacyManager::INDIVIDUAL_SENSOR_MICROPHONE);
- spm.addIndividualSensorPrivacyListener(userId,
- SensorPrivacyManager::INDIVIDUAL_SENSOR_MICROPHONE, this);
-}
-
void AudioPolicyService::SensorPrivacyPolicy::unregisterSelf() {
SensorPrivacyManager spm;
spm.removeSensorPrivacyListener(this);
@@ -1498,7 +1490,8 @@
return mSensorPrivacyEnabled;
}
-binder::Status AudioPolicyService::SensorPrivacyPolicy::onSensorPrivacyChanged(bool enabled) {
+binder::Status AudioPolicyService::SensorPrivacyPolicy::onSensorPrivacyChanged(
+ int toggleType __unused, int sensor __unused, bool enabled) {
mSensorPrivacyEnabled = enabled;
sp<AudioPolicyService> service = mService.promote();
if (service != nullptr) {