OSDN Git Service

Bluetooth: HID: Use proper values of connection status
authorHemant Gupta <hemantg@codeaurora.org>
Tue, 24 Dec 2013 08:22:36 +0000 (13:52 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 23 Apr 2015 21:30:03 +0000 (21:30 +0000)
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 [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 91e715d..4e4c6e0
@@ -112,11 +112,8 @@ final class HidProfile implements LocalBluetoothProfile {
         if (mService == null) {
             return BluetoothProfile.STATE_DISCONNECTED;
         }
-        List<BluetoothDevice> 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) {