summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Iurii Makhno <iuriimak@google.com> 2022-08-25 15:57:52 +0000
committer Iurii Makhno <iuriimak@google.com> 2022-08-25 15:57:52 +0000
commitcfc559b1891f594775185608ed50ca0bd0e43ced (patch)
tree46df586b4bc89e8524d4f68ba2f8b19b15267439
parenta833d0f25bab61cb3b9c089bc760f68664ede8b2 (diff)
Expose default ('--_--') locale in proto format.
Bug: b/243145989 Test: Dump_test Change-Id: Ie56aabb0f9b4b923d560470db7b426ab6ee34bd2
-rw-r--r--tools/aapt2/dump/DumpManifest.cpp4
-rw-r--r--tools/aapt2/integration-tests/DumpTest/components_expected_proto.txt1
-rw-r--r--tools/aapt2/integration-tests/DumpTest/components_full_proto.txt1
3 files changed, 5 insertions, 1 deletions
diff --git a/tools/aapt2/dump/DumpManifest.cpp b/tools/aapt2/dump/DumpManifest.cpp
index b3165d320e9b..2a5ad9606bb6 100644
--- a/tools/aapt2/dump/DumpManifest.cpp
+++ b/tools/aapt2/dump/DumpManifest.cpp
@@ -2845,7 +2845,9 @@ bool ManifestExtractor::DumpProto(pb::Badging* out_badging) {
supports_screen_->ToProtoScreens(out_badging, target_sdk_);
for (auto& config : locales_) {
- if (!config.first.empty()) {
+ if (config.first.empty()) {
+ out_badging->add_locales("--_--");
+ } else {
out_badging->add_locales(config.first);
}
}
diff --git a/tools/aapt2/integration-tests/DumpTest/components_expected_proto.txt b/tools/aapt2/integration-tests/DumpTest/components_expected_proto.txt
index 775641054c06..4aed4afa2753 100644
--- a/tools/aapt2/integration-tests/DumpTest/components_expected_proto.txt
+++ b/tools/aapt2/integration-tests/DumpTest/components_expected_proto.txt
@@ -94,6 +94,7 @@ badging {
provided_components: "camera"
provided_components: "camera-secure"
}
+ locales: "--_--"
densities: 160
densities: 240
densities: 320
diff --git a/tools/aapt2/integration-tests/DumpTest/components_full_proto.txt b/tools/aapt2/integration-tests/DumpTest/components_full_proto.txt
index 8e733a5db034..c783f47f8142 100644
--- a/tools/aapt2/integration-tests/DumpTest/components_full_proto.txt
+++ b/tools/aapt2/integration-tests/DumpTest/components_full_proto.txt
@@ -94,6 +94,7 @@ badging {
provided_components: "camera"
provided_components: "camera-secure"
}
+ locales: "--_--"
densities: 160
densities: 240
densities: 320