Add equals() for Resources.Theme

Bug: 155881035
Test: added a test case in cts
Change-Id: Icd0b3f4112f95ab2fc6ddfbd1b6ed7b2e85f1a3b
This commit is contained in:
Yurii Zubrytskyi
2021-12-06 20:24:43 -08:00
parent 7e1daf7862
commit 35f44aab7c

View File

@@ -1923,6 +1923,25 @@ public class Resources {
}
}
}
@Override
public int hashCode() {
return getKey().hashCode();
}
@Override
public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass() || hashCode() != o.hashCode()) {
return false;
}
final Theme other = (Theme) o;
return getKey().equals(other.getKey());
}
}
static class ThemeKey implements Cloneable {