Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17005bdf authored by Grace Jia's avatar Grace Jia
Browse files

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
parent 4220511d
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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;
                }
            }