diff options
Diffstat (limited to 'core/java/android/bluetooth')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothUuid.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java index 409c744..0596b21 100644 --- a/core/java/android/bluetooth/BluetoothUuid.java +++ b/core/java/android/bluetooth/BluetoothUuid.java @@ -98,7 +98,14 @@ public final class BluetoothUuid { */ public static boolean containsAnyUuid(ParcelUuid[] uuidA, ParcelUuid[] uuidB) { if (uuidA == null && uuidB == null) return true; - if (uuidA == null || uuidB == null) return false; + + if (uuidA == null) { + return uuidB.length == 0 ? true : false; + } + + if (uuidB == null) { + return uuidA.length == 0 ? true : false; + } HashSet<ParcelUuid> uuidSet = new HashSet<ParcelUuid> (Arrays.asList(uuidA)); for (ParcelUuid uuid: uuidB) { @@ -117,7 +124,12 @@ public final class BluetoothUuid { */ public static boolean containsAllUuids(ParcelUuid[] uuidA, ParcelUuid[] uuidB) { if (uuidA == null && uuidB == null) return true; - if (uuidA == null || uuidB == null) return false; + + if (uuidA == null) { + return uuidB.length == 0 ? true : false; + } + + if (uuidB == null) return true; HashSet<ParcelUuid> uuidSet = new HashSet<ParcelUuid> (Arrays.asList(uuidA)); for (ParcelUuid uuid: uuidB) { |
