summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-21 15:37:21 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-21 15:37:21 -0400
commit163be61ce5ea85181da3a8908adaa63b5ff56a7e (patch)
tree9bb04c0d149cd3ca2f2b508b738cd07ce191e809 /core/java/android
parente3578d60c6fbe17c116048a6b4de60b0ac42961f (diff)
parentdca2f0fec30e6acbdc466fd6dffb425877e7728a (diff)
downloadframeworks_base-163be61ce5ea85181da3a8908adaa63b5ff56a7e.zip
frameworks_base-163be61ce5ea85181da3a8908adaa63b5ff56a7e.tar.gz
frameworks_base-163be61ce5ea85181da3a8908adaa63b5ff56a7e.tar.bz2
Merge change 25412 into eclair
* changes: Make ParcelUuid helper functions consistent.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/bluetooth/BluetoothUuid.java16
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) {