diff options
| author | 2021-03-25 09:24:09 +0000 | |
|---|---|---|
| committer | 2021-03-25 09:24:09 +0000 | |
| commit | 05dfc3d84932e4ab285470e5a19e83a5cda8211d (patch) | |
| tree | 58745a28b1a9dcc292a5ec34c808f4a81de3b376 | |
| parent | 8fe0541d85951d312a601fbd0378261e561fde62 (diff) | |
| parent | 3ab94db67aadd1a2c2afb2bed4e840ec902fa1bf (diff) | |
Merge "Refactor Global Mic Disable" into sc-dev
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubService.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java index 830c3ea336e0..4d302b19d89b 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java @@ -301,7 +301,7 @@ public class ContextHubService extends IContextHubService.Stub { mSensorPrivacyManagerInternal.addSensorPrivacyListenerForAllUsers( SensorPrivacyManager.Sensors.MICROPHONE, (userId, enabled) -> { if (userId == getCurrentUserId()) { - Log.d(TAG, "User: " + userId + " enabled: " + enabled); + Log.d(TAG, "User: " + userId + "mic privacy: " + enabled); sendMicrophoneDisableSettingUpdate(enabled); } }); diff --git a/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java b/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java index 3245fdfaebd6..7be47a4e52a8 100644 --- a/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java +++ b/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java @@ -324,8 +324,11 @@ public abstract class IContextHubWrapper { } public void onMicrophoneDisableSettingChanged(boolean enabled) { - sendSettingChanged(android.hardware.contexthub.V1_2.Setting.GLOBAL_MIC_DISABLE, - enabled ? SettingValue.ENABLED : SettingValue.DISABLED); + // The SensorPrivacyManager reports if microphone privacy was enabled, + // which translates to microphone access being disabled (and vice-versa). + // With this in mind, we flip the argument before piping it to CHRE. + sendSettingChanged(android.hardware.contexthub.V1_2.Setting.MICROPHONE, + enabled ? SettingValue.DISABLED : SettingValue.ENABLED); } private void sendSettingChanged(byte setting, byte newValue) { |