Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7b2b225 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh Committed by Android Git Automerger
Browse files

am 6e3ee10a: Fix auto connection of A2DP profile.

Merge commit '6e3ee10a' into eclair-plus-aosp

* commit '6e3ee10a':
  Fix auto connection of A2DP profile.
parents 74c71c24 6e3ee10a
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -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