diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-08-22 19:10:56 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2014-08-25 17:47:30 -0700 |
commit | 31245b4f06003f1c8cd44c31b387c96ab4e282f9 (patch) | |
tree | ec59d73e6b6e563876ed8c4e5de331b4df17549e /tools/aapt/AaptConfig.cpp | |
parent | 5b8e5a7d4c930b42e1a3c2b3e67144b89d37efa2 (diff) |
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/AaptConfig.cpp')
-rw-r--r-- | tools/aapt/AaptConfig.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt/AaptConfig.cpp b/tools/aapt/AaptConfig.cpp index 69a9c7feca99..32a0cd3d4872 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; |