summaryrefslogtreecommitdiffstats
path: root/tools/aapt
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-08-22 19:10:56 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-08-25 17:47:30 -0700
commit31245b4f06003f1c8cd44c31b387c96ab4e282f9 (patch)
treeec59d73e6b6e563876ed8c4e5de331b4df17549e /tools/aapt
parent5b8e5a7d4c930b42e1a3c2b3e67144b89d37efa2 (diff)
downloadframeworks_base-31245b4f06003f1c8cd44c31b387c96ab4e282f9.zip
frameworks_base-31245b4f06003f1c8cd44c31b387c96ab4e282f9.tar.gz
frameworks_base-31245b4f06003f1c8cd44c31b387c96ab4e282f9.tar.bz2
Introduce anydpi density resource qualifier
This is meant to be used with scaleable vector drawables, and are chosen as the best match unless there is a configuration that matches the density requested exactly. Bug:17007265 Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
Diffstat (limited to 'tools/aapt')
-rw-r--r--tools/aapt/AaptConfig.cpp7
-rw-r--r--tools/aapt/Bundle.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/aapt/AaptConfig.cpp b/tools/aapt/AaptConfig.cpp
index 69a9c7f..32a0cd3 100644
--- a/tools/aapt/AaptConfig.cpp
+++ b/tools/aapt/AaptConfig.cpp
@@ -255,6 +255,8 @@ void applyVersionForCompatibility(ConfigDescription* config) {
!= ResTable_config::SCREENLONG_ANY
|| config->density != ResTable_config::DENSITY_DEFAULT) {
minSdk = SDK_DONUT;
+ } else if ((config->density == ResTable_config::DENSITY_ANY)) {
+ minSdk = SDK_L;
}
if (minSdk > config->sdkVersion) {
@@ -477,6 +479,11 @@ bool parseDensity(const char* name, ResTable_config* out) {
return true;
}
+ if (strcmp(name, "anydpi") == 0) {
+ if (out) out->density = ResTable_config::DENSITY_ANY;
+ return true;
+ }
+
if (strcmp(name, "nodpi") == 0) {
if (out) out->density = ResTable_config::DENSITY_NONE;
return true;
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index 1439f14..af49461 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -24,6 +24,7 @@ enum {
SDK_HONEYCOMB_MR2 = 13,
SDK_ICE_CREAM_SANDWICH = 14,
SDK_ICE_CREAM_SANDWICH_MR1 = 15,
+ SDK_L = 21,
};
/*