Implement individual Bluetooth profile connect/disconnect.

Allow individual Bluetooth profiles to be connected/disconnected from
the device's settings pane.

Bug: 3137982
Change-Id: I21512c5bf965fc523f3dc1e83d029b16b5e22440
This commit is contained in:
Jake Hamby
2010-11-03 12:47:51 -07:00
parent b14e1e0493
commit e79f990490
9 changed files with 96 additions and 41 deletions

View File

@@ -225,7 +225,7 @@ public abstract class LocalBluetoothProfileManager {
}
// TODO: int instead of enum
public enum Profile {
public static enum Profile {
HEADSET(R.string.bluetooth_profile_headset),
A2DP(R.string.bluetooth_profile_a2dp),
OPP(R.string.bluetooth_profile_opp),
@@ -433,7 +433,7 @@ public abstract class LocalBluetoothProfileManager {
public boolean disconnect(BluetoothDevice device) {
List<BluetoothDevice> deviceList = getConnectedDevices();
if (deviceList.size() != 0 && deviceList.get(0).equals(device)) {
// Downgrade prority as user is disconnecting the headset.
// Downgrade priority as user is disconnecting the headset.
if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
mService.setPriority(device, BluetoothProfile.PRIORITY_ON);
}