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
This commit is contained in:
Hemant Gupta
2013-12-24 13:52:36 +05:30
committed by Andre Eisenbach
parent 377c7c9afa
commit dd796e81c3

5
src/com/android/settings/bluetooth/HidProfile.java Executable file → Normal file
View File

@@ -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) {