From: Hemant Gupta Date: Tue, 24 Dec 2013 08:22:36 +0000 (+0530) Subject: Bluetooth: HID: Use proper values of connection status X-Git-Tag: android-x86-6.0-r1~623^2~1^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dd796e81c32293ec4425e7f0ad964a84af0df5ce;p=android-x86%2Fpackages-apps-Settings.git Bluetooth: HID: Use proper values of connection status This patch fixes issue in retrieving correct connection status when more than one hid device was connected to DUT. In such situation current implementation was sending STATE_DISCONNECTED as connection state because of wrong check of matching device as 1st device in connected device list. Instead of this now actual connection state device is retrieved from HidService. Change-Id: I2c766e9fc6eb9e97c3745016e38fa5c374c16539 --- diff --git a/src/com/android/settings/bluetooth/HidProfile.java b/src/com/android/settings/bluetooth/HidProfile.java old mode 100755 new mode 100644 index 91e715d0a1..4e4c6e00b9 --- a/src/com/android/settings/bluetooth/HidProfile.java +++ b/src/com/android/settings/bluetooth/HidProfile.java @@ -112,11 +112,8 @@ final class HidProfile implements LocalBluetoothProfile { if (mService == null) { return BluetoothProfile.STATE_DISCONNECTED; } - List deviceList = mService.getConnectedDevices(); - return !deviceList.isEmpty() && deviceList.get(0).equals(device) - ? mService.getConnectionState(device) - : BluetoothProfile.STATE_DISCONNECTED; + return mService.getConnectionState(device); } public boolean isPreferred(BluetoothDevice device) {