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

Commit 11f3c8ac authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioService: clear caller identity before broadcasting intent"

parents 57c99d3a da42712c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2919,12 +2919,15 @@ public class AudioService extends IAudioService.Stub
            final boolean currentMute = AudioSystem.isMicrophoneMuted();
            final long identity = Binder.clearCallingIdentity();
            AudioSystem.muteMicrophone(muted);
            Binder.restoreCallingIdentity(identity);
            try {
                if (muted != currentMute) {
                    mContext.sendBroadcastAsUser(
                        new Intent(AudioManager.ACTION_MICROPHONE_MUTE_CHANGED)
                                .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), UserHandle.ALL);
                }
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
    }