summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java')
-rw-r--r--src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
index 6179dc7..01714fe 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
@@ -370,7 +370,10 @@ public abstract class LocalBluetoothProfileManager {
public boolean connect(BluetoothDevice device) {
// Since connectHeadset fails if already connected to a headset, we
// disconnect from any headset first
- mService.disconnectHeadset();
+ BluetoothDevice currDevice = mService.getCurrentHeadset();
+ if (currDevice != null) {
+ mService.disconnectHeadset(currDevice);
+ }
return mService.connectHeadset(device);
}
@@ -381,7 +384,7 @@ public abstract class LocalBluetoothProfileManager {
if (mService.getPriority(device) > BluetoothHeadset.PRIORITY_ON) {
mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);
}
- return mService.disconnectHeadset();
+ return mService.disconnectHeadset(device);
} else {
return false;
}
@@ -391,7 +394,7 @@ public abstract class LocalBluetoothProfileManager {
public int getConnectionStatus(BluetoothDevice device) {
BluetoothDevice currentDevice = mService.getCurrentHeadset();
return currentDevice != null && currentDevice.equals(device)
- ? convertState(mService.getState())
+ ? convertState(mService.getState(device))
: SettingsBtStatus.CONNECTION_STATUS_DISCONNECTED;
}