diff options
author | 2022-05-12 12:49:02 -0700 | |
---|---|---|
committer | 2022-05-12 12:49:02 -0700 | |
commit | 17005bdfb036cb92ae72d6847f165cd203180552 (patch) | |
tree | 1afb82758b6c0acfe6c3085555e9e4734ad1697a /telecomm | |
parent | 4220511d7e72253dea93550424c8212ca3eb18e5 (diff) |
Support comparison of byte array values in areBundlesEqual
Currently, telecom framework will send tons of unnecessary
Call#onDetailsChanged to notify update between Call.Details
with same byte[] value. Since we didn't support the proper way to
compare these value, onDetailsChanged might be called multiple times
meaninglessly.
Bug: 232180843
Test: CallDetailsTest
Change-Id: I739412da62f303cb00dc84cb0a6d7773d0a0aeaa
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/Call.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 980ea5cd7f8c..432af3aa1aa0 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -2895,7 +2895,19 @@ public final class Call { if (key != null) { final Object value = bundle.get(key); final Object newValue = newBundle.get(key); - if (!Objects.equals(value, newValue)) { + if (!newBundle.containsKey(key)) { + return false; + } + if (value instanceof Bundle && newValue instanceof Bundle) { + if (!areBundlesEqual((Bundle) value, (Bundle) newValue)) { + return false; + } + } + if (value instanceof byte[] && newValue instanceof byte[]) { + if (!Arrays.equals((byte[]) value, (byte[]) newValue)) { + return false; + } + } else if (!Objects.equals(value, newValue)) { return false; } } |