am a7e07fde: am 1f567039: am 60823dc1: am 90460c79: Merge "Add more intelligence to bluetooth connection state" into mnc-dev

* commit 'a7e07fded12f7bd4198fd80f6e22ea1deabda43c':
  Add more intelligence to bluetooth connection state
This commit is contained in:
Jason Monk
2015-08-13 15:07:36 +00:00
committed by Android Git Automerger

View File

@@ -164,11 +164,18 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
// Our current device is still valid.
return;
}
mLastDevice = null;
for (CachedBluetoothDevice device : getDevices()) {
if (device.isConnected()) {
mLastDevice = device;
}
}
if (mLastDevice == null && mConnectionState == BluetoothAdapter.STATE_CONNECTED) {
// If somehow we think we are connected, but have no connected devices, we aren't
// connected.
mConnectionState = BluetoothAdapter.STATE_DISCONNECTED;
mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED);
}
}
@Override