From dd796e81c32293ec4425e7f0ad964a84af0df5ce Mon Sep 17 00:00:00 2001 From: Hemant Gupta Date: Tue, 24 Dec 2013 13:52:36 +0530 Subject: [PATCH] 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 --- src/com/android/settings/bluetooth/HidProfile.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) mode change 100755 => 100644 src/com/android/settings/bluetooth/HidProfile.java 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 91e715d0a1b..4e4c6e00b98 --- 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) {