OSDN Git Service

Add FLAG_RECEIVER_FOREGROUND to audio state broadcasts
authorZach Johnson <zachoverflow@google.com>
Sun, 18 Oct 2015 04:10:31 +0000 (21:10 -0700)
committerZach Johnson <zachoverflow@google.com>
Sun, 18 Oct 2015 04:10:31 +0000 (21:10 -0700)
This is important so audio can be rejected in a timely manner
when necessary.

Change-Id: I4a7789d262ac74c5014b34eb959d502a68217362

src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java

index f9cadab..21d38e2 100644 (file)
@@ -2242,6 +2242,7 @@ final class HeadsetClientStateMachine extends StateMachine {
 
     private void broadcastAudioState(BluetoothDevice device, int newState, int prevState) {
         Intent intent = new Intent(BluetoothHeadsetClient.ACTION_AUDIO_STATE_CHANGED);
+        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
         intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState);
         intent.putExtra(BluetoothProfile.EXTRA_STATE, newState);