summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-12-10 18:07:36 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-10 18:07:36 -0800
commitd2a910077a833bac1b985c4c780172b0e43d18b6 (patch)
tree7308617962a276cb9c02396e998e1bc78caa1dfb
parentc3ce286b5cd1bb4faf3c1e3f804c6b27afd23fd3 (diff)
parent41fccf2cb3cc31a79bd59492990207247f0a5c64 (diff)
downloadpackages_apps_settings-d2a910077a833bac1b985c4c780172b0e43d18b6.zip
packages_apps_settings-d2a910077a833bac1b985c4c780172b0e43d18b6.tar.gz
packages_apps_settings-d2a910077a833bac1b985c4c780172b0e43d18b6.tar.bz2
am 41fccf2c: am 6e3ee10a: Fix auto connection of A2DP profile.
Merge commit '41fccf2cb3cc31a79bd59492990207247f0a5c64' into eclair-mr2-plus-aosp * commit '41fccf2cb3cc31a79bd59492990207247f0a5c64': Fix auto connection of A2DP profile.
-rw-r--r--src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
index b488c22..24ba045 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
@@ -214,8 +214,13 @@ public abstract class LocalBluetoothProfileManager {
@Override
public void setPreferred(BluetoothDevice device, boolean preferred) {
- mService.setSinkPriority(device,
- preferred ? BluetoothA2dp.PRIORITY_AUTO_CONNECT : BluetoothA2dp.PRIORITY_OFF);
+ if (preferred) {
+ if (mService.getSinkPriority(device) < BluetoothA2dp.PRIORITY_ON) {
+ mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_ON);
+ }
+ } else {
+ mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_OFF);
+ }
}
@Override
@@ -328,8 +333,13 @@ public abstract class LocalBluetoothProfileManager {
@Override
public void setPreferred(BluetoothDevice device, boolean preferred) {
- mService.setPriority(device,
- preferred ? BluetoothHeadset.PRIORITY_AUTO_CONNECT : BluetoothHeadset.PRIORITY_OFF);
+ if (preferred) {
+ if (mService.getPriority(device) < BluetoothHeadset.PRIORITY_ON) {
+ mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);
+ }
+ } else {
+ mService.setPriority(device, BluetoothHeadset.PRIORITY_OFF);
+ }
}
@Override