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

Commit cde03ec6 authored by xutianguo's avatar xutianguo Committed by android-build-merger
Browse files

Merge "Fix potenial NPE in PhonePolicy" am: 244dc6aa

am: 5c775df1

Change-Id: I8dd502a549a19a5f3e8152f8b8c14d7fd59d088b
parents 62273279 5c775df1
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -387,9 +387,10 @@ class PhonePolicy {
        switch (profileId) {
            case BluetoothProfile.HEADSET:
                HeadsetService hsService = mFactory.getHeadsetService();
                List<BluetoothDevice> deviceList = hsService.getConnectedDevices();
                if ((hsService != null) && (BluetoothProfile.PRIORITY_AUTO_CONNECT
                if ((hsService != null)
                        && (BluetoothProfile.PRIORITY_AUTO_CONNECT
                                   != hsService.getPriority(device))) {
                    List<BluetoothDevice> deviceList = hsService.getConnectedDevices();
                    adjustOtherHeadsetPriorities(hsService, deviceList);
                    hsService.setPriority(device, BluetoothProfile.PRIORITY_AUTO_CONNECT);
                }