summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Winson Chiu <chiuwinson@google.com> 2022-03-04 23:18:46 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-03-04 23:18:46 +0000
commit2090094ef1b9763f5937b2e3fff3e849a1f43de7 (patch)
treeeb7071eb21f54ee75247cf6460ef0d5820112301 /tools/aapt2/ResourceParser.cpp
parentbae82662888f16955bc04abfa47166e3062ea197 (diff)
parent2222f486b2cb67904506b40d5f946b867b85dc76 (diff)
Merge "AAPT2: support removed_ entries in groups" into tm-dev am: 2222f486b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17085903 Change-Id: I6fbb32ad5eb74223bba1950cedf3665007cf1f76
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r--tools/aapt2/ResourceParser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 49784e3a3491..a99e4b234c6b 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -1040,6 +1040,13 @@ bool static ParseGroupImpl(xml::XmlPullParser* parser, ParsedResource* out_resou
continue;
}
+ if (maybe_name.value().substr(0, std::strlen("removed_")) == "removed_") {
+ // Skip resources that have been removed from the framework, but leave a hole so that
+ // other staged resources don't shift and break apps previously compiled against them
+ next_id.id++;
+ continue;
+ }
+
ParsedResource& entry_res = out_resource->child_resources.emplace_back(ParsedResource{
.name = ResourceName{{}, parsed_type, maybe_name.value().to_string()},
.source = item_source,