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

Commit 44376d0e authored by Weichin Weng's avatar Weichin Weng Committed by Automerger Merge Worker
Browse files

Merge "Support set active device to null." into rvc-dev am: f41c48a1 am:...

Merge "Support set active device to null." into rvc-dev am: f41c48a1 am: 3e49f7bd am: a7e284ea

Change-Id: Ie3b000350b686990b627a9e99e7be8f711b56d64
parents c0e5c54b a7e284ea
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -2367,21 +2367,24 @@ public class AdapterService extends Service {
                return false;
        }

        if (setA2dp && mA2dpService != null && mA2dpService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
            Log.i(TAG, "setActiveDevice: Setting active A2dp device " + device.getAddress());
        if (setA2dp && mA2dpService != null && (device == null
                || mA2dpService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) {
            Log.i(TAG, "setActiveDevice: Setting active A2dp device " + device);
            mA2dpService.setActiveDevice(device);
        }

        if (mHearingAidService != null && mHearingAidService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
            Log.i(TAG, "setActiveDevice: Setting active Hearing Aid " + device.getAddress());
        if (mHearingAidService != null && (device == null
                || mHearingAidService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) {
            Log.i(TAG, "setActiveDevice: Setting active Hearing Aid " + device);
            mHearingAidService.setActiveDevice(device);
        }

        if (setHeadset && mHeadsetService != null && mHeadsetService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
            Log.i(TAG, "setActiveDevice: Setting active Headset " + device.getAddress());
        if (setHeadset && mHeadsetService != null && (device == null
                || mHeadsetService.getConnectionPolicy(device)
                == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) {
            Log.i(TAG, "setActiveDevice: Setting active Headset " + device);
            mHeadsetService.setActiveDevice(device);
        }