summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2017-08-07 22:28:43 +0000
committer android-build-merger <android-build-merger@google.com> 2017-08-07 22:28:43 +0000
commitff9914ee5637bf6c152be6d3f78b2dfee7ec60ec (patch)
tree69538bd38ef2b5bf9331af64cad93d9f0a50bf35
parente5ebdc3c973ac19226273a354849039d2061e1a2 (diff)
parenta5fc11d78e85ca1a962d63a911ce8b56a747a70d (diff)
Merge "AAPT2: Add targetConfig to AndroidManifest.xml" into oc-mr1-dev
am: a5fc11d78e Change-Id: Id751b5a4c087fa062a31e88e153302a326fe34a8
-rw-r--r--tools/aapt2/cmd/Util.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt2/cmd/Util.cpp b/tools/aapt2/cmd/Util.cpp
index 8741b7b678ec..e1c45d68f611 100644
--- a/tools/aapt2/cmd/Util.cpp
+++ b/tools/aapt2/cmd/Util.cpp
@@ -179,6 +179,13 @@ std::unique_ptr<xml::XmlResource> GenerateSplitManifest(const AppInfo& app_info,
xml::Attribute{"", "configForSplit", app_info.split_name.value()});
}
+ // Splits may contain more configurations than originally desired (fallback densities, etc.).
+ // This makes programmatic discovery of split targetting difficult. Encode the original
+ // split constraints intended for this split.
+ std::stringstream target_config_str;
+ target_config_str << util::Joiner(constraints.configs, ",");
+ manifest_el->attributes.push_back(xml::Attribute{"", "targetConfig", target_config_str.str()});
+
std::unique_ptr<xml::Element> application_el = util::make_unique<xml::Element>();
application_el->name = "application";
application_el->attributes.push_back(