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

Commit 244dc6aa authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix potenial NPE in PhonePolicy"

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