From 42499a85e8825539af41e74ea2728169a27e1ace Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Wed, 25 Nov 2009 15:54:25 -0800 Subject: [PATCH] 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. --- .../settings/bluetooth/LocalBluetoothProfileManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java index a19fc63bb1c..44e2be34728 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java @@ -176,6 +176,8 @@ public abstract class LocalBluetoothProfileManager { @Override public boolean disconnect(BluetoothDevice device) { + // Downgrade priority as user is disconnecting the sink. + mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_ON); return mService.disconnectSink(device); } @@ -269,6 +271,8 @@ public abstract class LocalBluetoothProfileManager { @Override public boolean disconnect(BluetoothDevice device) { if (mService.getCurrentHeadset().equals(device)) { + // Downgrade prority as user is disconnecting the headset. + mService.setPriority(device, BluetoothHeadset.PRIORITY_ON); return mService.disconnectHeadset(); } else { return false; @@ -302,7 +306,7 @@ public abstract class LocalBluetoothProfileManager { @Override public void setPreferred(BluetoothDevice device, boolean preferred) { mService.setPriority(device, - preferred ? BluetoothHeadset.PRIORITY_AUTO : BluetoothHeadset.PRIORITY_OFF); + preferred ? BluetoothHeadset.PRIORITY_AUTO_CONNECT : BluetoothHeadset.PRIORITY_OFF); } @Override