AAPT: Ignore densities specified in -c flag

The --preferred-density flag knows how to handle missing resources of
specific densities. Using -c with a density leads to missing resources.

Change-Id: I2251d842f48c08ed083663bb7ed608e14c4983c8
This commit is contained in:
Adam Lesinski
2014-11-10 17:56:11 -08:00
parent 85d558cd48
commit a2bb565db5

View File

@@ -41,6 +41,13 @@ WeakResourceFilter::parse(const String8& str)
// Ignore the version
entry.second &= ~ResTable_config::CONFIG_VERSION;
// Ignore any densities. Those are best handled in --preferred-density
if ((entry.second & ResTable_config::CONFIG_DENSITY) != 0) {
fprintf(stderr, "warning: ignoring flag -c %s. Use --preferred-density instead.\n", entry.first.toString().string());
entry.first.density = 0;
entry.second &= ~ResTable_config::CONFIG_DENSITY;
}
mConfigMask |= entry.second;
}