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

Commit a28b3135 authored by Sanket Agarwal's avatar Sanket Agarwal
Browse files

Ignore ACTION_UUID intent when no uuids present

When no uuids are present, parsing UUIDs throws NPE in PhonePolicy

Bug: b/34640345
Test: Manual test by trying various devices. Follow up unit tests
required

Change-Id: Ibe54ea7b62b644ba1d92ef4f1d850c09113875af
parent d8f2b503
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -137,12 +137,15 @@ class PhonePolicy {
                                    .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
                    Parcelable[] uuids =
                            ((Intent) msg.obj).getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);

                    Log.d(TAG, "UUIDs on ACTION_UUID: " + uuids + " for device " + device);
                    if (uuids != null) {
                        ParcelUuid[] uuidsToSend = new ParcelUuid[uuids.length];
                        for (int i = 0; i < uuidsToSend.length; i++) {
                            uuidsToSend[i] = (ParcelUuid) uuids[i];
                        }

                        processInitProfilePriorities(device, uuidsToSend);
                    }
                } break;

                case MESSAGE_PROFILE_CONNECTION_STATE_CHANGED: {