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.
This commit is contained in:
Jaikumar Ganesh
2009-12-10 18:07:36 -08:00
committed by Android Git Automerger

View File

@@ -214,8 +214,13 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public void setPreferred(BluetoothDevice device, boolean preferred) { public void setPreferred(BluetoothDevice device, boolean preferred) {
mService.setSinkPriority(device, if (preferred) {
preferred ? BluetoothA2dp.PRIORITY_AUTO_CONNECT : BluetoothA2dp.PRIORITY_OFF); if (mService.getSinkPriority(device) < BluetoothA2dp.PRIORITY_ON) {
mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_ON);
}
} else {
mService.setSinkPriority(device, BluetoothA2dp.PRIORITY_OFF);
}
} }
@Override @Override
@@ -328,8 +333,13 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public void setPreferred(BluetoothDevice device, boolean preferred) { public void setPreferred(BluetoothDevice device, boolean preferred) {
mService.setPriority(device, if (preferred) {
preferred ? BluetoothHeadset.PRIORITY_AUTO_CONNECT : BluetoothHeadset.PRIORITY_OFF); if (mService.getPriority(device) < BluetoothHeadset.PRIORITY_ON) {
mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);
}
} else {
mService.setPriority(device, BluetoothHeadset.PRIORITY_OFF);
}
} }
@Override @Override