summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-12-21 14:17:15 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-12-21 14:17:15 -0800
commit11b97c50e6fb6d723e88eac3c125b60ca42184f7 (patch)
tree7fcbb23a510c663a45df4777114256f9b8b4f7e5 /core
parent87ed10d78d290f48d382a6e628241da0c61cfb45 (diff)
parent551ed72940af6e4f0b34a1d05282497a547e9a7c (diff)
downloadframeworks_base-11b97c50e6fb6d723e88eac3c125b60ca42184f7.zip
frameworks_base-11b97c50e6fb6d723e88eac3c125b60ca42184f7.tar.gz
frameworks_base-11b97c50e6fb6d723e88eac3c125b60ca42184f7.tar.bz2
Merge change I551ed729 into eclair
* changes: Use UNDEFINED priorities when unpaired.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/bluetooth/BluetoothA2dp.java2
-rw-r--r--core/java/android/bluetooth/BluetoothHeadset.java2
-rw-r--r--core/java/android/server/BluetoothA2dpService.java6
3 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java
index fda9b81..7e5f858 100644
--- a/core/java/android/bluetooth/BluetoothA2dp.java
+++ b/core/java/android/bluetooth/BluetoothA2dp.java
@@ -83,6 +83,8 @@ public final class BluetoothA2dp {
/** Default priority for a2dp devices that should not allow incoming
* connections */
public static final int PRIORITY_OFF = 0;
+ /** Default priority when not set or when the device is unpaired */
+ public static final int PRIORITY_UNDEFINED = -1;
private final IBluetoothA2dp mService;
private final Context mContext;
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java
index 5eb655a..b792965 100644
--- a/core/java/android/bluetooth/BluetoothHeadset.java
+++ b/core/java/android/bluetooth/BluetoothHeadset.java
@@ -109,6 +109,8 @@ public final class BluetoothHeadset {
/** Default priority for headsets that should not be auto-connected
* and not allow incoming connections. */
public static final int PRIORITY_OFF = 0;
+ /** Default priority when not set or when the device is unpaired */
+ public static final int PRIORITY_UNDEFINED = -1;
/** The voice dialer 'works' but the user experience is poor. The voice
* recognizer has trouble dealing with the 8kHz SCO signal, and it still
diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java
index f2e132b..dfec1eb 100644
--- a/core/java/android/server/BluetoothA2dpService.java
+++ b/core/java/android/server/BluetoothA2dpService.java
@@ -96,11 +96,13 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
BluetoothDevice.ERROR);
switch(bondState) {
case BluetoothDevice.BOND_BONDED:
- setSinkPriority(device, BluetoothA2dp.PRIORITY_ON);
+ if (getSinkPriority(device) == BluetoothA2dp.PRIORITY_UNDEFINED) {
+ setSinkPriority(device, BluetoothA2dp.PRIORITY_ON);
+ }
break;
case BluetoothDevice.BOND_BONDING:
case BluetoothDevice.BOND_NONE:
- setSinkPriority(device, BluetoothA2dp.PRIORITY_OFF);
+ setSinkPriority(device, BluetoothA2dp.PRIORITY_UNDEFINED);
break;
}
} else if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {