summaryrefslogtreecommitdiffstats
path: root/tools/aapt
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-11-10 17:56:11 -0800
committerAdam Lesinski <adamlesinski@google.com>2014-11-10 17:56:11 -0800
commita2bb565db553e3def89a6e010b59f2fd1db98ff4 (patch)
tree9f50b0b4c146eb4b8557f51661ee5d198fd87a2d /tools/aapt
parent85d558cd486d195aabfc4b43cff8f338126f60a5 (diff)
downloadframeworks_base-a2bb565db553e3def89a6e010b59f2fd1db98ff4.zip
frameworks_base-a2bb565db553e3def89a6e010b59f2fd1db98ff4.tar.gz
frameworks_base-a2bb565db553e3def89a6e010b59f2fd1db98ff4.tar.bz2
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
Diffstat (limited to 'tools/aapt')
-rw-r--r--tools/aapt/ResourceFilter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt/ResourceFilter.cpp b/tools/aapt/ResourceFilter.cpp
index fc95e14..8693999 100644
--- a/tools/aapt/ResourceFilter.cpp
+++ b/tools/aapt/ResourceFilter.cpp
@@ -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;
}