From 9c4b83c53b0c4626267610866bba9e34a5a9c299 Mon Sep 17 00:00:00 2001 From: Agatha Man Date: Mon, 17 Jun 2019 15:02:18 -0700 Subject: [PATCH] Modified AudioService to broadcast ACTION_MICROPHONE_MUTE_CHANGE intent to all users Before this change, ACTION_MICROPHONE_MUTE_CHANGED was broadcasting only to system user. This causes CTS test, AudioManagerTest#testMicrophoneMuteIntent to fail when the device is running on secondary user. This change modifies the broadcast to all users. Bug: 134509101 Test: make, flash local, then atest android.media.cts.AudioManagerTest#testMicrophoneMuteIntent Change-Id: Idaf46782429dd4f3094fc5f6eb92da1a3e811b7b --- .../core/java/com/android/server/audio/AudioService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index e698b841a2fd7..2a598774a2e17 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -2520,8 +2520,9 @@ public class AudioService extends IAudioService.Stub AudioSystem.muteMicrophone(on); Binder.restoreCallingIdentity(identity); if (on != currentMute) { - mContext.sendBroadcast(new Intent(AudioManager.ACTION_MICROPHONE_MUTE_CHANGED) - .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY)); + mContext.sendBroadcastAsUser( + new Intent(AudioManager.ACTION_MICROPHONE_MUTE_CHANGED) + .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), UserHandle.ALL); } } }