summaryrefslogtreecommitdiff
path: root/libs/androidfw
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-09-14 13:11:22 -0700
committerRyan Mitchell <rtmitchell@google.com>2020-09-17 08:18:27 -0700
commit0a0bf365553c614a7ca1ab96a1aa71047fc48081 (patch)
tree22060764946404390d7f3c6937d84537f98234f9 /libs/androidfw
parent4cb1ece9d1f0dfc61f15ad0e568748604846ccd3 (diff)
Make configs differing only in density siblings
Configurations differing only in density value will match the same device configuration at runtime; therefore, they should be considered sibling configurations in the dominator tree. So, given configurations A and B: 1) If A has a density defined and B does not, A must never dominate B. 2) If A and B both have densities defined, neither must dominate the other. Previous behavior: <default> sw600dp-v13 sw600dp-hdpi-v13 sw800dp-hdpi-v13 sw800dp-xxhdpi-v13 New behavior: <default> sw600dp-v13 sw600dp-hdpi-v13 sw800dp-hdpi-v13 sw800dp-xxhdpi-v13 Bug: 167944889 Test: aapt2_tests Merged-In: Ie9fba4c4b74af2b3bbf8fc6432539a99f8647634 Change-Id: Ie9fba4c4b74af2b3bbf8fc6432539a99f8647634
Diffstat (limited to 'libs/androidfw')
-rw-r--r--libs/androidfw/include/androidfw/ConfigDescription.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/androidfw/include/androidfw/ConfigDescription.h b/libs/androidfw/include/androidfw/ConfigDescription.h
index acf413aeaf91..61d10cd4e55b 100644
--- a/libs/androidfw/include/androidfw/ConfigDescription.h
+++ b/libs/androidfw/include/androidfw/ConfigDescription.h
@@ -177,9 +177,8 @@ inline ConfigDescription& ConfigDescription::operator=(ConfigDescription&& o) no
return *this;
}
-inline bool ConfigDescription::MatchWithDensity(
- const ConfigDescription& o) const {
- return match(o) && (density == 0 || density == o.density);
+inline bool ConfigDescription::MatchWithDensity(const ConfigDescription& o) const {
+ return match(o) && (density == 0 || o.density != 0);
}
inline bool ConfigDescription::operator<(const ConfigDescription& o) const {