Fix runtime reboot when connecting to a A2DP headset and

user toggles BT state.

Bug:2607218

This happens when Bluetooth is turned off, and when the headset is
still trying to connect. We get the connection result of
attempt before Bluetooth was toggled. We need to ignore this result.

Change-Id: I023406ec6d59880754ca4f1de676d0dce71b13c6
This commit is contained in:
Jaikumar Ganesh
2010-04-19 17:19:31 -07:00
parent 8d30b2d284
commit 55b0110fc2
2 changed files with 2 additions and 0 deletions

View File

@ -554,6 +554,7 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
if (!result) {
if (deviceObjectPath != null) {
String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath);
if (address == null) return;
BluetoothDevice device = mAdapter.getRemoteDevice(address);
int state = getSinkState(device);
handleSinkStateChange(device, state, BluetoothA2dp.STATE_DISCONNECTED);