summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2021-03-22 09:31:00 -0700
committerRyan Mitchell <rtmitchell@google.com>2021-03-29 16:33:16 -0700
commit2e9bec1154b8342ae6914498edd2e0fb15e36957 (patch)
treef605a39a176afd39c9ffcc18fd71b4c8c74e75a9 /tools/aapt2/java/JavaClassGenerator.cpp
parent1d008d1d2a73a8b796add4e18924fcc99220a839 (diff)
Add staging-public-group to aapt2
staging-public-group is a tag for putting resources that have been added during platform development, but have not yet been finalized, into a separate resource id namespace. R.java fields of staged resources are non-final, so when the SDK is finalized, applications using the android R.java will automatically use the new finalized resource id without having to recompile. Staged resources can exist either in the same type id as the type's non-staged counterpart or in a separate type id. Multiple staging-public-group tags each with a different type id can exist simultaneously, which allows for multiple versions of the platform to be developed at once. Bug: 183411093 Test: aapt2_tests Change-Id: Ibb6c84c3626751e33c6097f35a03e306bb85616a
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
-rw-r--r--tools/aapt2/java/JavaClassGenerator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp
index 039448e1b3e9..e1e2e0135cf7 100644
--- a/tools/aapt2/java/JavaClassGenerator.cpp
+++ b/tools/aapt2/java/JavaClassGenerator.cpp
@@ -460,7 +460,8 @@ void JavaClassGenerator::ProcessResource(const ResourceNameRef& name, const Reso
const std::string field_name = TransformToFieldName(name.entry);
if (out_class_def != nullptr) {
- auto resource_member = util::make_unique<ResourceMember>(field_name, real_id);
+ auto resource_member =
+ util::make_unique<ResourceMember>(field_name, real_id, entry.visibility.staged_api);
// Build the comments and annotations for this entry.
AnnotationProcessor* processor = resource_member->GetCommentBuilder();