diff options
| author | 2015-08-13 14:59:15 +0000 | |
|---|---|---|
| committer | 2015-08-13 14:59:15 +0000 | |
| commit | a7e07fded12f7bd4198fd80f6e22ea1deabda43c (patch) | |
| tree | a49be686bc87a6aa3cd6d361fd561283aae89329 | |
| parent | a35ada4846d3794408825c10ee8a6070a1590044 (diff) | |
| parent | 1f567039e042314d378b4fb50279e81d773e8733 (diff) | |
am 1f567039: am 60823dc1: am 90460c79: Merge "Add more intelligence to bluetooth connection state" into mnc-dev
* commit '1f567039e042314d378b4fb50279e81d773e8733':
Add more intelligence to bluetooth connection state
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java index daa84ad80ccf..a04edf77ea54 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java @@ -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 |