Always select the next higher density bucket when picking resources
This reverts commit 30715f3afc061bd25a5f251554efc56c412d02d5.
Reason for revert: roll forward with fix
Change-Id: I6d63e6fa508501f2d029eeb4647d4d70c152ceb3
Test: ran all previously failing tests locally
Fixes: 183136881
diff --git a/libs/androidfw/tests/Config_test.cpp b/libs/androidfw/tests/Config_test.cpp
index b54915f..698c36f 100644
--- a/libs/androidfw/tests/Config_test.cpp
+++ b/libs/androidfw/tests/Config_test.cpp
@@ -75,6 +75,9 @@
configs.add(buildDensityConfig(int(ResTable_config::DENSITY_HIGH) + 20));
ASSERT_EQ(expectedBest, selectBest(deviceConfig, configs));
+ configs.add(buildDensityConfig(int(ResTable_config::DENSITY_XHIGH) - 1));
+ ASSERT_EQ(expectedBest, selectBest(deviceConfig, configs));
+
expectedBest = buildDensityConfig(ResTable_config::DENSITY_XHIGH);
configs.add(expectedBest);
ASSERT_EQ(expectedBest, selectBest(deviceConfig, configs));