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

Commit c9a6258f authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioService: make sure intents are received by AudioService before 3p apps

Register the AudioService intent receiver with SYSTEM_HIGH_PRIORITY
to make sure important intent broacasts about Bluetooth state changes,
device connections, user switches etc are received by AudioService before apps.

Bug: 284026341
Test: make
Change-Id: I83d7b25bf07f8eca41a1d5c1a86717f1f1fcabbe
parent 69e0c717
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1368,6 +1368,7 @@ public class AudioService extends IAudioService.Stub
        intentFilter.addAction(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
        intentFilter.addAction(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
        intentFilter.addAction(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
        intentFilter.addAction(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
        intentFilter.addAction(ACTION_CHECK_MUSIC_ACTIVE);
        intentFilter.addAction(ACTION_CHECK_MUSIC_ACTIVE);
        intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiverAsUser(mReceiver, UserHandle.ALL, intentFilter, null, null,
        mContext.registerReceiverAsUser(mReceiver, UserHandle.ALL, intentFilter, null, null,
                Context.RECEIVER_EXPORTED);
                Context.RECEIVER_EXPORTED);