Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eefa1c41 authored by Dmitry Shmidt's avatar Dmitry Shmidt Committed by android-build-merger
Browse files

Merge "AudioService: Fix Mic Mute restriction processing" am: 94ec4598

am: af89aaa6

Change-Id: I9c886b41cc738cc05fe66c17599b9d3abd4f791c
parents 9409ec02 af89aaa6
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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) {