summaryrefslogtreecommitdiff
path: root/tools/aapt2/cmd/Link.cpp
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2020-06-22 10:17:02 -0700
committerMakoto Onuki <omakoto@google.com>2020-06-23 09:35:36 -0700
commiteab9e7f8014fa67164fb9a14ccd9dd624c802c51 (patch)
treec64628fbc16a9fa621395d2451e789c99dafbc5d /tools/aapt2/cmd/Link.cpp
parentbdc57bef813d07a837202bae3040c98dd64506a0 (diff)
Don't add API annotations in the internal R.java
I'm trying to enable a check for the following structure: ``` /** @hide */ public class Class1 { /** @hide */ @SystemApi // Invalid because the class is hidden. public void method1() { } } ``` The internal R.java file violates this, which this change is going to fix. Bug: 159162473 Test: build (treehugger) Test: atest aapt2_tests Merged-in: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9 Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
Diffstat (limited to 'tools/aapt2/cmd/Link.cpp')
-rw-r--r--tools/aapt2/cmd/Link.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index 7afb0000aea1..85414fb8a4e5 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -1252,7 +1252,8 @@ class Linker {
return false;
}
- ClassDefinition::WriteJavaFile(manifest_class.get(), package_utf8, true, &fout);
+ ClassDefinition::WriteJavaFile(manifest_class.get(), package_utf8, true,
+ false /* strip_api_annotations */, &fout);
fout.Flush();
if (fout.HadError()) {