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

Commit 4822149c authored by Amit Shekhar's avatar Amit Shekhar Committed by Steve Kondik
Browse files

frameworks/base: Fix delay in sending AUDIO_BECOMING_NOISY intent

AUDIO_BECOMING_NOISY intent is sent as background intent which causes
delay in receiving pause event. This delay caused audio leak. By
marking the event as FLAG_RECEIVER_FOREGROUND, this intent is
received sooner by Application.

Change-Id: Ib978cf8322dcddbc01f59824f95fa7800f9c35af
CRs-Fixed: 652549
parent 4f741a43
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -4645,7 +4645,9 @@ public class AudioService extends IAudioService.Stub {
    }
    }


    private void onSendBecomingNoisyIntent() {
    private void onSendBecomingNoisyIntent() {
        sendBroadcastToAll(new Intent(AudioManager.ACTION_AUDIO_BECOMING_NOISY));
        Intent intent = new Intent(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        sendBroadcastToAll(intent);
    }
    }


    // must be called synchronized on mConnectedDevices
    // must be called synchronized on mConnectedDevices