Merge "Check for null Parcels array in hasNonMidiUuids." into tm-dev am: a7b858cd2d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17570954

Change-Id: Ic8f4672efbd7eddf2fa8f9da967d029d338502a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Paul Mclean
2022-04-04 21:10:54 +00:00
committed by Automerger Merge Worker

View File

@@ -685,11 +685,13 @@ public class MidiService extends IMidiManager.Stub {
private boolean hasNonMidiUuids(BluetoothDevice btDevice) { private boolean hasNonMidiUuids(BluetoothDevice btDevice) {
ParcelUuid[] uuidParcels = btDevice.getUuids(); ParcelUuid[] uuidParcels = btDevice.getUuids();
// The assumption is that these services are indicative of devices that if (uuidParcels != null) {
// ARE NOT MIDI devices. // The assumption is that these services are indicative of devices that
for (ParcelUuid parcel : uuidParcels) { // ARE NOT MIDI devices.
if (mNonMidiUUIDs.contains(parcel)) { for (ParcelUuid parcel : uuidParcels) {
return true; if (mNonMidiUUIDs.contains(parcel)) {
return true;
}
} }
} }
return false; return false;