The other states aren't really that important, and
this reduces the chance of ANR.
Change-Id: Ie019b81a9fbfb9238cf8b6cce1308d0d7358cbf8
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);
}