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
This commit is contained in:
Eric Laurent
2023-06-06 11:03:31 +02:00
parent 69e0c71705
commit c9a6258f7d

View File

@@ -1368,6 +1368,7 @@ public class AudioService extends IAudioService.Stub
intentFilter.addAction(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
intentFilter.addAction(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
intentFilter.addAction(ACTION_CHECK_MUSIC_ACTIVE);
intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
mContext.registerReceiverAsUser(mReceiver, UserHandle.ALL, intentFilter, null, null,
Context.RECEIVER_EXPORTED);