We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AndroidComponentAddress one = AndroidComponentAddress.forBindIntent(new Intent() .setComponent("package", "service") ); AndroidComponentAddress two = AndroidComponentAddress.forBindIntent(new Intent() .setComponent("package", "service") .setPackage("package") ); assert(!one.equals(two) || (one.hashCode() == two.hashCode()))
No assertion error. The Object API contract says that if one.equals(two) then one.hashCode() == two.hashCode().
Assertion error because, since Android SDK 31, one.equals(two) but one.hashCode() != two.hashCode().
AndroidComponentAddress implements hashCode() and equals() by delegating to Intent.filterHashcode() and filterEquals(). But since https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/9324284 filterHashcode() and filterEquals() are no longer consistent the way Object requires when a (redundant) setPackage() filter is present.
The text was updated successfully, but these errors were encountered:
@jdcormie do you have someone specific in mind to assign this bug to?
Sorry, something went wrong.
binder: Work around an Android Intent bug (#9061)
fba4ae4
Where filterEquals() can be inconsistent with filterHashCode(). Fixes #9045
Successfully merging a pull request may close this issue.
Steps to reproduce the bug
What did you expect to see?
No assertion error. The Object API contract says that if one.equals(two) then one.hashCode() == two.hashCode().
What did you see instead?
Assertion error because, since Android SDK 31, one.equals(two) but one.hashCode() != two.hashCode().
AndroidComponentAddress implements hashCode() and equals() by delegating to Intent.filterHashcode() and filterEquals(). But since https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/9324284 filterHashcode() and filterEquals() are no longer consistent the way Object requires when a (redundant) setPackage() filter is present.
The text was updated successfully, but these errors were encountered: