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

Commit f5228482 authored by Yasuhiro Matsuda's avatar Yasuhiro Matsuda Committed by Android (Google) Code Review
Browse files

Merge "Do not broadcast ACTION_AUDIO_BECOMING_NOISY on first boot."

parents b02c6555 4ced7193
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -477,6 +477,8 @@ public class AudioService extends IAudioService.Stub {

    // true if boot sequence has been completed
    private boolean mSystemReady;
    // true if Intent.ACTION_USER_SWITCHED has ever been received
    private boolean mUserSwitchedReceived;
    // listener for SoundPool sample load completion indication
    private SoundPoolCallback mSoundPoolCallBack;
    // thread for SoundPool listener
@@ -5059,7 +5061,9 @@ public class AudioService extends IAudioService.Stub {
            } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
                handleConfigurationChanged(context);
            } else if (action.equals(Intent.ACTION_USER_SWITCHED)) {
                // attempt to stop music playback for background user
                if (mUserSwitchedReceived) {
                    // attempt to stop music playback for background user except on first user
                    // switch (i.e. first boot)
                    sendMsg(mAudioHandler,
                            MSG_BROADCAST_AUDIO_BECOMING_NOISY,
                            SENDMSG_REPLACE,
@@ -5067,6 +5071,8 @@ public class AudioService extends IAudioService.Stub {
                            0,
                            null,
                            0);
                }
                mUserSwitchedReceived = true;
                // the current audio focus owner is no longer valid
                mMediaFocusControl.discardAudioFocusOwner();