From 2b3880718d0692af4f97e49de2bddf03208b61b0 Mon Sep 17 00:00:00 2001 From: Evan Severson Date: Thu, 18 Mar 2021 14:57:24 -0700 Subject: [PATCH] Make the muteFromPrivacyToggle state transparent If the toggle is set it shouldn't mask the other ways the mic may be muted. Doing so may causes callers of setMicrophoneMute to skip unmuting if they think the mic is already unmuted. Test: I promise to do the repro steps when it reaches droidfood.daily Fixes: 183139242 Change-Id: I39901970465750d18ad7f0f8c222e3ba975a726a --- services/core/java/com/android/server/audio/AudioService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 1950710a36e0a..4748f6bcc83fe 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -3861,7 +3861,9 @@ public class AudioService extends IAudioService.Stub * @return true if microphone is reported as muted by primary HAL */ public boolean isMicrophoneMuted() { - return mMicMuteFromSystemCached && !mMicMuteFromPrivacyToggle; + return mMicMuteFromSystemCached + && (!mMicMuteFromPrivacyToggle + || mMicMuteFromApi || mMicMuteFromRestrictions || mMicMuteFromSwitch); } private boolean isMicrophoneSupposedToBeMuted() {