From f5f1b891b0fb306672ea4a951aff7776d148af7d Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 2 Oct 2019 14:11:03 -0700 Subject: [PATCH] AudioService: Fix Mic Mute restriction processing Bug: 141192769 Test: Manual Change-Id: I26ac98a0572ecf48cc61deb95b7fa894aed8e3d4 Signed-off-by: Dmitry Shmidt --- .../core/java/com/android/server/audio/AudioService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 7f7ef172f14d8..e26cbc4487f90 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -1566,12 +1566,13 @@ public class AudioService extends IAudioService.Stub AudioSystem.setMasterMute(masterMute); broadcastMasterMuteStatus(masterMute); - boolean microphoneMute = mUserManagerInternal.getUserRestriction( + mMicMuteFromRestrictions = mUserManagerInternal.getUserRestriction( currentUser, UserManager.DISALLOW_UNMUTE_MICROPHONE); if (DEBUG_VOL) { - Log.d(TAG, String.format("Mic mute %s, user=%d", microphoneMute, currentUser)); + Log.d(TAG, String.format("Mic mute %b, user=%d", mMicMuteFromRestrictions, + currentUser)); } - AudioSystem.muteMicrophone(microphoneMute); + setMicrophoneMuteNoCallerCheck(currentUser); } private int rescaleIndex(int index, int srcStream, int dstStream) { @@ -2876,7 +2877,7 @@ public class AudioService extends IAudioService.Stub private void setMicrophoneMuteNoCallerCheck(int userId) { final boolean muted = isMicrophoneMuted(); if (DEBUG_VOL) { - Log.d(TAG, String.format("Mic mute %d, user=%d", muted, userId)); + Log.d(TAG, String.format("Mic mute %b, user=%d", muted, userId)); } // only mute for the current user if (getCurrentUserId() == userId || userId == android.os.Process.SYSTEM_UID) {