Merge "Remove connected device check logic in getConnectionState"
am: 8593fc6c06
Change-Id: I86b30d27d3d7ab35473e8710b100e5730dfa12a4
This commit is contained in:
@@ -29,7 +29,7 @@ import com.android.settingslib.R;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HidProfile handles Bluetooth HID profile.
|
* HidProfile handles Bluetooth HID Host role.
|
||||||
*/
|
*/
|
||||||
public class HidProfile implements LocalBluetoothProfile {
|
public class HidProfile implements LocalBluetoothProfile {
|
||||||
private static final String TAG = "HidProfile";
|
private static final String TAG = "HidProfile";
|
||||||
@@ -117,11 +117,7 @@ public class HidProfile implements LocalBluetoothProfile {
|
|||||||
if (mService == null) {
|
if (mService == null) {
|
||||||
return BluetoothProfile.STATE_DISCONNECTED;
|
return BluetoothProfile.STATE_DISCONNECTED;
|
||||||
}
|
}
|
||||||
List<BluetoothDevice> deviceList = mService.getConnectedDevices();
|
return mService.getConnectionState(device);
|
||||||
|
|
||||||
return !deviceList.isEmpty() && deviceList.get(0).equals(device)
|
|
||||||
? mService.getConnectionState(device)
|
|
||||||
: BluetoothProfile.STATE_DISCONNECTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPreferred(BluetoothDevice device) {
|
public boolean isPreferred(BluetoothDevice device) {
|
||||||
|
|||||||
Reference in New Issue
Block a user