summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Jeremy Meyer <jakmcbane@google.com> 2024-07-24 16:45:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-07-24 16:45:59 +0000
commit17b93515b3d87516180d87d4dcc1be11cf6f2dff (patch)
tree13581c6078cc4dd1c4ce3118cf6e9e0eaa54a8cd /tools/aapt2/ResourceParser.cpp
parentb31515402c6527f73a2fee8e69e5fa6818c10cdb (diff)
parentefa42b1e27efc2ff8cb39cf47141f9d59ca6d375 (diff)
Merge "Dont parse resource values behind disabled flags" into main
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r--tools/aapt2/ResourceParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 2df941834063..45bf8e38c5ce 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -690,7 +690,9 @@ bool ResourceParser::ParseResource(xml::XmlPullParser* parser,
resource_format = item_iter->second.format;
}
- if (!ParseItem(parser, out_resource, resource_format)) {
+ // Don't bother parsing the item if it is behind a disabled flag
+ if (out_resource->flag_status != FlagStatus::Disabled &&
+ !ParseItem(parser, out_resource, resource_format)) {
return false;
}
return true;