Merge "AudioService: Fix Mic Mute restriction processing" am: 94ec459834 am: af89aaa6b8

am: eefa1c4119

Change-Id: I02dd65ebe0cec5f5532cb3f3140d4bfc33b231bd
This commit is contained in:
Dmitry Shmidt
2019-10-03 10:30:20 -07:00
committed by android-build-merger

View File

@@ -1566,12 +1566,13 @@ public class AudioService extends IAudioService.Stub
AudioSystem.setMasterMute(masterMute); AudioSystem.setMasterMute(masterMute);
broadcastMasterMuteStatus(masterMute); broadcastMasterMuteStatus(masterMute);
boolean microphoneMute = mUserManagerInternal.getUserRestriction( mMicMuteFromRestrictions = mUserManagerInternal.getUserRestriction(
currentUser, UserManager.DISALLOW_UNMUTE_MICROPHONE); currentUser, UserManager.DISALLOW_UNMUTE_MICROPHONE);
if (DEBUG_VOL) { 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) { private int rescaleIndex(int index, int srcStream, int dstStream) {
@@ -2876,7 +2877,7 @@ public class AudioService extends IAudioService.Stub
private void setMicrophoneMuteNoCallerCheck(int userId) { private void setMicrophoneMuteNoCallerCheck(int userId) {
final boolean muted = isMicrophoneMuted(); final boolean muted = isMicrophoneMuted();
if (DEBUG_VOL) { 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 // only mute for the current user
if (getCurrentUserId() == userId || userId == android.os.Process.SYSTEM_UID) { if (getCurrentUserId() == userId || userId == android.os.Process.SYSTEM_UID) {