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