Return profile state disconnected when not yet bound to service.
Bug: 4007080 There is a another bug open to handle service object being null and a connect / disconnect call being made. Change-Id: I30f6923323532b5756338b350ec4ce0e1a31d1ff
This commit is contained in:
@@ -133,6 +133,8 @@ final class HeadsetProfile implements LocalBluetoothProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getConnectionStatus(BluetoothDevice device) {
|
public int getConnectionStatus(BluetoothDevice device) {
|
||||||
|
if (mService == null) return BluetoothProfile.STATE_DISCONNECTED;
|
||||||
|
|
||||||
List<BluetoothDevice> deviceList = mService.getConnectedDevices();
|
List<BluetoothDevice> deviceList = mService.getConnectedDevices();
|
||||||
|
|
||||||
return !deviceList.isEmpty() && deviceList.get(0).equals(device)
|
return !deviceList.isEmpty() && deviceList.get(0).equals(device)
|
||||||
|
Reference in New Issue
Block a user