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

This commit is contained in:
Paul Mclean
2022-04-04 20:32:04 +00:00
committed by Android (Google) Code Review

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;