Merge "Support comparison of byte array values in areBundlesEqual" into tm-dev am: 548c0800c2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18357438

Change-Id: Ic0b422b3b7bd711b64f3da8d1805318ffabdcaec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-13 17:44:54 +00:00
committed by Automerger Merge Worker

View File

@@ -2895,7 +2895,19 @@ public final class Call {
if (key != null) { if (key != null) {
final Object value = bundle.get(key); final Object value = bundle.get(key);
final Object newValue = newBundle.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; return false;
} }
} }