diff options
author | Zach Johnson <zachoverflow@google.com> | 2015-10-17 23:18:23 -0700 |
---|---|---|
committer | Zach Johnson <zachoverflow@google.com> | 2015-10-17 23:18:23 -0700 |
commit | 5040e76e2b2742a210e5e1ef29ae1b1779f12ee3 (patch) | |
tree | 751095fa9a0f54f80b2217a219292e4ae766a591 | |
parent | 5d0f29737bfa7d9e2891b1e99c87e86fce434599 (diff) | |
download | android_packages_apps_Bluetooth-5040e76e2b2742a210e5e1ef29ae1b1779f12ee3.tar.gz android_packages_apps_Bluetooth-5040e76e2b2742a210e5e1ef29ae1b1779f12ee3.tar.bz2 android_packages_apps_Bluetooth-5040e76e2b2742a210e5e1ef29ae1b1779f12ee3.zip |
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
-rw-r--r-- | src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |