am 7d4cf23f
: am 9e191aa6
: am a6562603
: am 1e9bfc64
: Fix incorrect android.telecom.Call.Details equality check.
* commit '7d4cf23f8a57b73055a5d9310df074dc149be577': Fix incorrect android.telecom.Call.Details equality check.
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user