summaryrefslogtreecommitdiffstats
path: root/telecomm/java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-08-19 22:41:14 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-19 22:41:14 +0000
commit9e191aa634c1eb3b24ced704b7fc6c5e1e4ef9c0 (patch)
tree81e3fe78354aed34eecd0e4315be3c828e63283d /telecomm/java
parentd7121f565138c8ec31bcc7a5d1cef57dc21cf546 (diff)
parenta65626031017517331fd402541b5e8f072c46a34 (diff)
downloadframeworks_base-9e191aa634c1eb3b24ced704b7fc6c5e1e4ef9c0.zip
frameworks_base-9e191aa634c1eb3b24ced704b7fc6c5e1e4ef9c0.tar.gz
frameworks_base-9e191aa634c1eb3b24ced704b7fc6c5e1e4ef9c0.tar.bz2
am a6562603: am 1e9bfc64: Fix incorrect android.telecom.Call.Details equality check.
* commit 'a65626031017517331fd402541b5e8f072c46a34': Fix incorrect android.telecom.Call.Details equality check.
Diffstat (limited to 'telecomm/java')
-rw-r--r--telecomm/java/android/telecom/Call.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 49f738b..f149f24 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -512,8 +512,8 @@ public final class Call {
Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
Objects.equals(mVideoState, d.mVideoState) &&
Objects.equals(mStatusHints, d.mStatusHints) &&
- Objects.equals(mExtras, d.mExtras) &&
- Objects.equals(mIntentExtras, d.mIntentExtras);
+ areBundlesEqual(mExtras, d.mExtras) &&
+ areBundlesEqual(mIntentExtras, d.mIntentExtras);
}
return false;
}
@@ -1252,4 +1252,32 @@ public final class Call {
});
}
}
+
+ /**
+ * Determines if two bundles are equal.
+ *
+ * @param bundle The original bundle.
+ * @param newBundle The bundle to compare with.
+ * @retrun {@code true} if the bundles are equal, {@code false} otherwise.
+ */
+ private static boolean areBundlesEqual(Bundle bundle, Bundle newBundle) {
+ if (bundle == null || newBundle == null) {
+ return bundle == newBundle;
+ }
+
+ if (bundle.size() != newBundle.size()) {
+ return false;
+ }
+
+ for(String key : bundle.keySet()) {
+ if (key != null) {
+ final Object value = bundle.get(key);
+ final Object newValue = newBundle.get(key);
+ if (!Objects.equals(value, newValue)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
}