Remove BT routes when BT is turned off

A behavior change in the BT stack caused it to stop sending connection
changes for connected devices when you turn BT off. To work around this
we need to remove the connected BT route when BT is turned off.

bug:17512270
Change-Id: I3e5aa8863409c5abac51aa4e93a15f1978cf74b3
This commit is contained in:
RoboErik
2014-09-25 14:53:16 -07:00
parent eecc904f13
commit 5535ea8ef8

View File

@@ -4174,6 +4174,14 @@ public class AudioService extends IAudioService.Stub {
AudioSystem.DEVICE_STATE_UNAVAILABLE,
address);
mConnectedDevices.remove(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP);
synchronized (mCurAudioRoutes) {
// Remove A2DP routes as well
if (mCurAudioRoutes.mBluetoothName != null) {
mCurAudioRoutes.mBluetoothName = null;
sendMsg(mAudioHandler, MSG_REPORT_NEW_ROUTES,
SENDMSG_NOOP, 0, 0, null, 0);
}
}
}
// must be called synchronized on mConnectedDevices