From a46af4e6479ed22e3649dcf373aabfb9b82a5f5a Mon Sep 17 00:00:00 2001 From: Jack He Date: Wed, 26 Jul 2017 23:51:23 -0700 Subject: [PATCH] Bluetooth: show multi-device status in Quick Settings * In Quick Settings, BluetoothTile used BluetoothController to track BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED intent that is only fired when 1st device is connecting/connected and last device is disconnecting/disconnected. As result, non-first device's connecting/connected states and non-last device's disconnecting/disconnected states are not tracked properly. * Instead, CachedBluetoothDevice.getMaxConnectionState() should be used Bug: 63509289 Test: Connect to multiple devices and disconnect from multiple devices Change-Id: I9ccc2d3e9e4ae1a44f4d270368a8f07030353544 --- .../src/com/android/systemui/qs/tiles/BluetoothTile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java index 14afbfae29f17..c6914981be453 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java @@ -269,7 +269,7 @@ public class BluetoothTile extends QSTileImpl { item.icon = R.drawable.ic_qs_bluetooth_on; item.line1 = device.getName(); item.tag = device; - int state = mController.getMaxConnectionState(device); + int state = device.getMaxConnectionState(); if (state == BluetoothProfile.STATE_CONNECTED) { item.icon = R.drawable.ic_qs_bluetooth_connected; int batteryLevel = device.getBatteryLevel();