Change priority for Headset profile on the same lines as A2DP profile.

AUTO_CONNECT => we auto_connect.
ON => Settings app box is checked and we allow incoming connections.
OFF => Settings app check box is unchecked.
This commit is contained in:
Jaikumar Ganesh
2009-11-25 15:54:25 -08:00
parent 210667f353
commit 42499a85e8

View File

@@ -176,6 +176,8 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public boolean disconnect(BluetoothDevice device) { public boolean disconnect(BluetoothDevice device) {
// Downgrade priority as user is disconnecting the sink.
mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_ON);
return mService.disconnectSink(device); return mService.disconnectSink(device);
} }
@@ -269,6 +271,8 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public boolean disconnect(BluetoothDevice device) { public boolean disconnect(BluetoothDevice device) {
if (mService.getCurrentHeadset().equals(device)) { if (mService.getCurrentHeadset().equals(device)) {
// Downgrade prority as user is disconnecting the headset.
mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);
return mService.disconnectHeadset(); return mService.disconnectHeadset();
} else { } else {
return false; return false;
@@ -302,7 +306,7 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public void setPreferred(BluetoothDevice device, boolean preferred) { public void setPreferred(BluetoothDevice device, boolean preferred) {
mService.setPriority(device, mService.setPriority(device,
preferred ? BluetoothHeadset.PRIORITY_AUTO : BluetoothHeadset.PRIORITY_OFF); preferred ? BluetoothHeadset.PRIORITY_AUTO_CONNECT : BluetoothHeadset.PRIORITY_OFF);
} }
@Override @Override