From 5040e76e2b2742a210e5e1ef29ae1b1779f12ee3 Mon Sep 17 00:00:00 2001 From: Zach Johnson Date: Sat, 17 Oct 2015 23:18:23 -0700 Subject: Only apply foreground flag for audio state connected The other states aren't really that important, and this reduces the chance of ANR. Change-Id: Ie019b81a9fbfb9238cf8b6cce1308d0d7358cbf8 --- src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java index 21d38e229..bc1833901 100644 --- a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +++ b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java @@ -2242,11 +2242,11 @@ 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); if (newState == BluetoothHeadsetClient.STATE_AUDIO_CONNECTED) { + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(BluetoothHeadsetClient.EXTRA_AUDIO_WBS, mAudioWbs); } -- cgit v1.2.3