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
(cherry picked from commit 0068bdad22ffd70c90de67b6e85c8a0dfa838d90)
diff --git a/src/com/android/bluetooth/btservice/PhonePolicy.java b/src/com/android/bluetooth/btservice/PhonePolicy.java
index 89fedb8..19817bf 100644
--- a/src/com/android/bluetooth/btservice/PhonePolicy.java
+++ b/src/com/android/bluetooth/btservice/PhonePolicy.java
@@ -137,12 +137,15 @@
                                     .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
                     Parcelable[] uuids =
                             ((Intent) msg.obj).getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);
-                    ParcelUuid[] uuidsToSend = new ParcelUuid[uuids.length];
-                    for (int i = 0; i < uuidsToSend.length; i++) {
-                        uuidsToSend[i] = (ParcelUuid) uuids[i];
-                    }
 
-                    processInitProfilePriorities(device, uuidsToSend);
+                    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: {