blob: 829c47383f04b36fd86ec2dd1238d982f8e6394a [file] [log] [blame]
Colin Cross8faf8fc2019-01-16 15:15:52 -08001// Copyright 2019 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package java
16
17import (
Colin Cross8faf8fc2019-01-16 15:15:52 -080018 "github.com/google/blueprint"
19
20 "android/soong/android"
21)
22
23var hiddenAPIGenerateCSVRule = pctx.AndroidStaticRule("hiddenAPIGenerateCSV", blueprint.RuleParams{
Andrei Onea23fea042020-08-12 16:48:23 +010024 Command: "${config.Class2NonSdkList} --stub-api-flags ${stubAPIFlags} $in $outFlag $out",
25 CommandDeps: []string{"${config.Class2NonSdkList}"},
David Brazdil0f670a22019-01-18 16:30:03 +000026}, "outFlag", "stubAPIFlags")
Colin Cross8faf8fc2019-01-16 15:15:52 -080027
Colin Crossf24a22a2019-01-31 14:12:44 -080028type hiddenAPI struct {
Paul Duffinf75e5272021-02-09 14:34:25 +000029 // The name of the module as it would be used in the boot jars configuration, e.g. without any
Paul Duffinf8f4af82021-02-12 15:42:20 +000030 // prebuilt_ prefix (if it is a prebuilt) and without any ".impl" suffix if it is a
31 // java_sdk_library implementation library.
Paul Duffinf75e5272021-02-09 14:34:25 +000032 configurationName string
33
34 // True if the module containing this structure contributes to the hiddenapi information or has
35 // that information encoded within it.
Paul Duffin4103e922021-02-01 19:01:34 +000036 active bool
37
Paul Duffinf75e5272021-02-09 14:34:25 +000038 // Identifies the active module variant which will be used as the source of hiddenapi information.
39 //
40 // A class may be compiled into a number of different module variants each of which will need the
41 // hiddenapi information encoded into it and so will be marked as active. However, only one of
42 // them must be used as a source of information by hiddenapi otherwise it will end up with
43 // duplicate entries. That module will have primary=true.
44 //
45 // Note, that modules <x>-hiddenapi that provide additional annotation information for module <x>
46 // that is on the bootclasspath are marked as primary=true as they are the primary source of that
47 // annotation information.
48 primary bool
49
Paul Duffinff774a02021-01-29 12:53:15 +000050 // The path to the dex jar that is in the boot class path. If this is nil then the associated
51 // module is not a boot jar, but could be one of the <x>-hiddenapi modules that provide additional
52 // annotations for the <x> boot dex jar but which do not actually provide a boot dex jar
53 // themselves.
Paul Duffin4103e922021-02-01 19:01:34 +000054 //
55 // This must be the path to the unencoded dex jar as the encoded dex jar indirectly depends on
56 // this file so using the encoded dex jar here would result in a cycle in the ninja rules.
Paul Duffinff774a02021-01-29 12:53:15 +000057 bootDexJarPath android.Path
58
Paul Duffin36187b22021-04-22 16:43:06 +010059 // The paths to the classes jars that contain classes and class members annotated with
60 // the UnsupportedAppUsage annotation that need to be extracted as part of the hidden API
61 // processing.
62 classesJarPaths android.Paths
Colin Crossf24a22a2019-01-31 14:12:44 -080063}
64
Colin Crossf24a22a2019-01-31 14:12:44 -080065func (h *hiddenAPI) bootDexJar() android.Path {
66 return h.bootDexJarPath
67}
68
Paul Duffin36187b22021-04-22 16:43:06 +010069func (h *hiddenAPI) classesJars() android.Paths {
70 return h.classesJarPaths
71}
72
Paul Duffin537ea3d2021-05-14 10:38:00 +010073// hiddenAPIModule is the interface a module that embeds the hiddenAPI structure must implement.
74type hiddenAPIModule interface {
75 android.Module
76 hiddenAPIIntf
77}
78
Colin Crossf24a22a2019-01-31 14:12:44 -080079type hiddenAPIIntf interface {
Colin Crossf24a22a2019-01-31 14:12:44 -080080 bootDexJar() android.Path
Paul Duffin36187b22021-04-22 16:43:06 +010081 classesJars() android.Paths
Colin Crossf24a22a2019-01-31 14:12:44 -080082}
83
84var _ hiddenAPIIntf = (*hiddenAPI)(nil)
85
Paul Duffin4103e922021-02-01 19:01:34 +000086// Initialize the hiddenapi structure
Paul Duffinf8f4af82021-02-12 15:42:20 +000087func (h *hiddenAPI) initHiddenAPI(ctx android.BaseModuleContext, configurationName string) {
Paul Duffin4103e922021-02-01 19:01:34 +000088 // If hiddenapi processing is disabled treat this as inactive.
89 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
90 return
91 }
92
Paul Duffinf75e5272021-02-09 14:34:25 +000093 h.configurationName = configurationName
Paul Duffin4103e922021-02-01 19:01:34 +000094
Paul Duffinb6f53c02021-05-14 07:52:42 +010095 // If the frameworks/base directories does not exist and no prebuilt hidden API flag files have
96 // been configured then it is not possible to do hidden API encoding.
97 if !ctx.Config().FrameworksBaseDirExists(ctx) && ctx.Config().PrebuiltHiddenApiDir(ctx) == "" {
98 return
99 }
100
Paul Duffin4103e922021-02-01 19:01:34 +0000101 // It is important that hiddenapi information is only gathered for/from modules that are actually
102 // on the boot jars list because the runtime only enforces access to the hidden API for the
103 // bootclassloader. If information is gathered for modules not on the list then that will cause
104 // failures in the CtsHiddenApiBlocklist... tests.
Paul Duffin82b3fcf2021-02-12 15:42:46 +0000105 module := ctx.Module()
106 h.active = isModuleInBootClassPath(ctx, module)
Paul Duffinf75e5272021-02-09 14:34:25 +0000107 if !h.active {
108 // The rest of the properties will be ignored if active is false.
109 return
110 }
Paul Duffin4103e922021-02-01 19:01:34 +0000111
Paul Duffinf75e5272021-02-09 14:34:25 +0000112 // Determine whether this module is the primary module or not.
113 primary := true
114
115 // A prebuilt module is only primary if it is preferred and conversely a source module is only
116 // primary if it has not been replaced by a prebuilt module.
Paul Duffinf75e5272021-02-09 14:34:25 +0000117 if pi, ok := module.(android.PrebuiltInterface); ok {
118 if p := pi.Prebuilt(); p != nil {
119 primary = p.UsePrebuilt()
120 }
121 } else {
Paul Duffinf8f4af82021-02-12 15:42:20 +0000122 // The only module that will pass a different configurationName to its module name to this
123 // method is the implementation library of a java_sdk_library. It has a configuration name of
124 // <x> the same as its parent java_sdk_library but a module name of <x>.impl. It is not the
125 // primary module, the java_sdk_library with the name of <x> is.
126 primary = configurationName == ctx.ModuleName()
Paul Duffinf75e5272021-02-09 14:34:25 +0000127
128 // A source module that has been replaced by a prebuilt can never be the primary module.
Paul Duffinec0fe172021-02-25 15:34:13 +0000129 if module.IsReplacedByPrebuilt() {
Paul Duffin894546d2021-04-21 01:03:30 +0100130 if ctx.HasProvider(android.ApexInfoProvider) {
131 // The source module is in an APEX but the prebuilt module on which it depends is not in an
132 // APEX and so is not the one that will actually be used for hidden API processing. That
133 // means it is not possible to check to see if it is a suitable replacement so just assume
134 // that it is.
135 primary = false
136 } else {
137 ctx.VisitDirectDepsWithTag(android.PrebuiltDepTag, func(prebuilt android.Module) {
138 if h, ok := prebuilt.(hiddenAPIIntf); ok && h.bootDexJar() != nil {
139 primary = false
140 } else {
141 ctx.ModuleErrorf(
142 "hiddenapi has determined that the source module %q should be ignored as it has been"+
143 " replaced by the prebuilt module %q but unfortunately it does not provide a"+
144 " suitable boot dex jar", ctx.ModuleName(), ctx.OtherModuleName(prebuilt))
145 }
146 })
147 }
Paul Duffinec0fe172021-02-25 15:34:13 +0000148 }
Paul Duffinf75e5272021-02-09 14:34:25 +0000149 }
150 h.primary = primary
Paul Duffin4103e922021-02-01 19:01:34 +0000151}
152
Paul Duffin82b3fcf2021-02-12 15:42:46 +0000153func isModuleInBootClassPath(ctx android.BaseModuleContext, module android.Module) bool {
154 // Get the configured non-updatable and updatable boot jars.
155 nonUpdatableBootJars := ctx.Config().NonUpdatableBootJars()
156 updatableBootJars := ctx.Config().UpdatableBootJars()
157 active := isModuleInConfiguredList(ctx, module, nonUpdatableBootJars) ||
158 isModuleInConfiguredList(ctx, module, updatableBootJars)
159 return active
160}
161
Paul Duffinafaa47c2021-05-14 13:04:04 +0100162// hiddenAPIEncodeDex is called by any module that needs to encode dex files.
Paul Duffin4103e922021-02-01 19:01:34 +0000163//
164// It ignores any module that has not had initHiddenApi() called on it and which is not in the boot
Paul Duffinafaa47c2021-05-14 13:04:04 +0100165// jar list. In that case it simply returns the supplied dex jar path.
Paul Duffin4103e922021-02-01 19:01:34 +0000166//
Paul Duffinafaa47c2021-05-14 13:04:04 +0100167// Otherwise, it creates a copy of the supplied dex file into which it has encoded the hiddenapi
168// flags and returns this instead of the supplied dex jar.
169func (h *hiddenAPI) hiddenAPIEncodeDex(ctx android.ModuleContext, dexJar android.OutputPath, uncompressDex bool) android.OutputPath {
Paul Duffin001e6062021-05-14 01:13:55 +0100170
Paul Duffin4103e922021-02-01 19:01:34 +0000171 if !h.active {
172 return dexJar
173 }
Paul Duffind2aceca2019-02-28 16:13:20 +0000174
Paul Duffinf8f4af82021-02-12 15:42:20 +0000175 hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", h.configurationName+".jar").OutputPath
Paul Duffina2058f82020-06-24 16:22:38 +0100176
Paul Duffinf8f4af82021-02-12 15:42:20 +0000177 // Create a copy of the dex jar which has been encoded with hiddenapi flags.
178 hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)
Paul Duffin4103e922021-02-01 19:01:34 +0000179
Paul Duffinf8f4af82021-02-12 15:42:20 +0000180 // Use the encoded dex jar from here onwards.
181 dexJar = hiddenAPIJar
Colin Crossf24a22a2019-01-31 14:12:44 -0800182
183 return dexJar
184}
185
Paul Duffinafaa47c2021-05-14 13:04:04 +0100186// hiddenAPIUpdatePaths generates ninja rules to extract the information from the classes
Paul Duffin4fd997b2021-02-03 20:06:33 +0000187// jar, and outputs it to the appropriate module specific CSV file.
188//
189// It also makes the dex jar available for use when generating the
190// hiddenAPISingletonPathsStruct.stubFlags.
Paul Duffinafaa47c2021-05-14 13:04:04 +0100191func (h *hiddenAPI) hiddenAPIUpdatePaths(ctx android.ModuleContext, dexJar, classesJar android.Path) {
Paul Duffin001e6062021-05-14 01:13:55 +0100192
193 // Save the classes jars even if this is not active as they may be used by modular hidden API
194 // processing.
195 classesJars := android.Paths{classesJar}
196 ctx.VisitDirectDepsWithTag(hiddenApiAnnotationsTag, func(dep android.Module) {
197 javaInfo := ctx.OtherModuleProvider(dep, JavaInfoProvider).(JavaInfo)
198 classesJars = append(classesJars, javaInfo.ImplementationJars...)
199 })
200 h.classesJarPaths = classesJars
201
202 // Save the unencoded dex jar so it can be used when generating the
203 // hiddenAPISingletonPathsStruct.stubFlags file.
204 h.bootDexJarPath = dexJar
Paul Duffin850e61f2021-05-14 09:58:48 +0100205}
206
207// buildRuleToGenerateAnnotationFlags builds a ninja rule to generate the annotation-flags.csv file
208// from the classes jars and stub-flags.csv files.
Paul Duffinafaa47c2021-05-14 13:04:04 +0100209//
210// The annotation-flags.csv file contains mappings from Java signature to various flags derived from
211// annotations in the source, e.g. whether it is public or the sdk version above which it can no
212// longer be used.
213//
214// It is created by the Class2NonSdkList tool which processes the .class files in the class
215// implementation jar looking for UnsupportedAppUsage and CovariantReturnType annotations. The
216// tool also consumes the hiddenAPISingletonPathsStruct.stubFlags file in order to perform
217// consistency checks on the information in the annotations and to filter out bridge methods
218// that are already part of the public API.
Paul Duffin850e61f2021-05-14 09:58:48 +0100219func buildRuleToGenerateAnnotationFlags(ctx android.ModuleContext, desc string, classesJars android.Paths, stubFlagsCSV android.Path, outputPath android.WritablePath) {
Colin Cross8faf8fc2019-01-16 15:15:52 -0800220 ctx.Build(pctx, android.BuildParams{
221 Rule: hiddenAPIGenerateCSVRule,
Paul Duffin850e61f2021-05-14 09:58:48 +0100222 Description: desc,
Paul Duffin031d8692021-02-12 11:46:42 +0000223 Inputs: classesJars,
Paul Duffin850e61f2021-05-14 09:58:48 +0100224 Output: outputPath,
David Brazdil0f670a22019-01-18 16:30:03 +0000225 Implicit: stubFlagsCSV,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800226 Args: map[string]string{
David Brazdil0f670a22019-01-18 16:30:03 +0000227 "outFlag": "--write-flags-csv",
228 "stubAPIFlags": stubFlagsCSV.String(),
Colin Cross8faf8fc2019-01-16 15:15:52 -0800229 },
230 })
Paul Duffin850e61f2021-05-14 09:58:48 +0100231}
Colin Cross8faf8fc2019-01-16 15:15:52 -0800232
Paul Duffin850e61f2021-05-14 09:58:48 +0100233// buildRuleToGenerateMetadata builds a ninja rule to generate the metadata.csv file from
234// the classes jars and stub-flags.csv files.
Paul Duffinafaa47c2021-05-14 13:04:04 +0100235//
236// The metadata.csv file contains mappings from Java signature to the value of properties specified
237// on UnsupportedAppUsage annotations in the source.
238//
239// Like the annotation-flags.csv file this is also created by the Class2NonSdkList in the same way.
240// Although the two files could potentially be created in a single invocation of the
241// Class2NonSdkList at the moment they are created using their own invocation, with the behavior
242// being determined by the property that is used.
Paul Duffin850e61f2021-05-14 09:58:48 +0100243func buildRuleToGenerateMetadata(ctx android.ModuleContext, desc string, classesJars android.Paths, stubFlagsCSV android.Path, metadataCSV android.WritablePath) {
Colin Cross8faf8fc2019-01-16 15:15:52 -0800244 ctx.Build(pctx, android.BuildParams{
245 Rule: hiddenAPIGenerateCSVRule,
Paul Duffin850e61f2021-05-14 09:58:48 +0100246 Description: desc,
Paul Duffin031d8692021-02-12 11:46:42 +0000247 Inputs: classesJars,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800248 Output: metadataCSV,
David Brazdil0f670a22019-01-18 16:30:03 +0000249 Implicit: stubFlagsCSV,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800250 Args: map[string]string{
David Brazdil0f670a22019-01-18 16:30:03 +0000251 "outFlag": "--write-metadata-csv",
252 "stubAPIFlags": stubFlagsCSV.String(),
Colin Cross8faf8fc2019-01-16 15:15:52 -0800253 },
254 })
Paul Duffin850e61f2021-05-14 09:58:48 +0100255}
Colin Cross8faf8fc2019-01-16 15:15:52 -0800256
Paul Duffinafaa47c2021-05-14 13:04:04 +0100257// buildRuleToGenerateIndex builds a ninja rule to generate the index.csv file from the classes
Paul Duffin850e61f2021-05-14 09:58:48 +0100258// jars.
Paul Duffinafaa47c2021-05-14 13:04:04 +0100259//
260// The index.csv file contains mappings from Java signature to source location information.
261//
262// It is created by the merge_csv tool which processes the class implementation jar, extracting
263// all the files ending in .uau (which are CSV files) and merges them together. The .uau files are
264// created by the unsupported app usage annotation processor during compilation of the class
265// implementation jar.
Paul Duffin850e61f2021-05-14 09:58:48 +0100266func buildRuleToGenerateIndex(ctx android.ModuleContext, desc string, classesJars android.Paths, indexCSV android.WritablePath) {
Colin Crossf1a035e2020-11-16 17:32:30 -0800267 rule := android.NewRuleBuilder(pctx, ctx)
Artur Satayevb5df8a02020-02-19 16:39:59 +0000268 rule.Command().
Colin Crossf1a035e2020-11-16 17:32:30 -0800269 BuiltTool("merge_csv").
Paul Duffin031d8692021-02-12 11:46:42 +0000270 Flag("--zip_input").
Paul Duffin2c36f242021-02-16 16:57:06 +0000271 Flag("--key_field signature").
Paul Duffin537ea3d2021-05-14 10:38:00 +0100272 FlagWithArg("--header=", "signature,file,startline,startcol,endline,endcol,properties").
Paul Duffin031d8692021-02-12 11:46:42 +0000273 FlagWithOutput("--output=", indexCSV).
274 Inputs(classesJars)
Paul Duffin850e61f2021-05-14 09:58:48 +0100275 rule.Build(desc, desc)
Colin Cross8faf8fc2019-01-16 15:15:52 -0800276}
277
278var hiddenAPIEncodeDexRule = pctx.AndroidStaticRule("hiddenAPIEncodeDex", blueprint.RuleParams{
Artur Satayevb5df8a02020-02-19 16:39:59 +0000279 Command: `rm -rf $tmpDir && mkdir -p $tmpDir && mkdir $tmpDir/dex-input && mkdir $tmpDir/dex-output &&
Colin Crossd783bbb2020-07-11 22:30:45 -0700280 unzip -qoDD $in 'classes*.dex' -d $tmpDir/dex-input &&
Artur Satayevb5df8a02020-02-19 16:39:59 +0000281 for INPUT_DEX in $$(find $tmpDir/dex-input -maxdepth 1 -name 'classes*.dex' | sort); do
282 echo "--input-dex=$${INPUT_DEX}";
283 echo "--output-dex=$tmpDir/dex-output/$$(basename $${INPUT_DEX})";
284 done | xargs ${config.HiddenAPI} encode --api-flags=$flagsCsv $hiddenapiFlags &&
285 ${config.SoongZipCmd} $soongZipFlags -o $tmpDir/dex.jar -C $tmpDir/dex-output -f "$tmpDir/dex-output/classes*.dex" &&
286 ${config.MergeZipsCmd} -D -zipToNotStrip $tmpDir/dex.jar -stripFile "classes*.dex" -stripFile "**/*.uau" $out $tmpDir/dex.jar $in`,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800287 CommandDeps: []string{
288 "${config.HiddenAPI}",
289 "${config.SoongZipCmd}",
290 "${config.MergeZipsCmd}",
291 },
David Brazdil91b4e3e2019-01-23 21:04:05 +0000292}, "flagsCsv", "hiddenapiFlags", "tmpDir", "soongZipFlags")
Colin Cross8faf8fc2019-01-16 15:15:52 -0800293
Colin Crossf24a22a2019-01-31 14:12:44 -0800294func hiddenAPIEncodeDex(ctx android.ModuleContext, output android.WritablePath, dexInput android.Path,
Colin Crosscd964b32019-01-18 22:03:02 -0800295 uncompressDex bool) {
296
Colin Crossf24a22a2019-01-31 14:12:44 -0800297 flagsCSV := hiddenAPISingletonPaths(ctx).flags
Colin Cross8faf8fc2019-01-16 15:15:52 -0800298
Colin Crosscd964b32019-01-18 22:03:02 -0800299 // The encode dex rule requires unzipping and rezipping the classes.dex files, ensure that if it was uncompressed
300 // in the input it stays uncompressed in the output.
301 soongZipFlags := ""
David Brazdil91b4e3e2019-01-23 21:04:05 +0000302 hiddenapiFlags := ""
Nicolas Geoffray65fd8ba2019-01-21 23:20:23 +0000303 tmpOutput := output
304 tmpDir := android.PathForModuleOut(ctx, "hiddenapi", "dex")
Colin Crosscd964b32019-01-18 22:03:02 -0800305 if uncompressDex {
306 soongZipFlags = "-L 0"
Nicolas Geoffray65fd8ba2019-01-21 23:20:23 +0000307 tmpOutput = android.PathForModuleOut(ctx, "hiddenapi", "unaligned", "unaligned.jar")
308 tmpDir = android.PathForModuleOut(ctx, "hiddenapi", "unaligned")
Colin Crosscd964b32019-01-18 22:03:02 -0800309 }
Jiyong Park93e57a02020-02-21 16:04:53 +0900310
311 enforceHiddenApiFlagsToAllMembers := true
Paul Duffinb6f53c02021-05-14 07:52:42 +0100312
Jiyong Park93e57a02020-02-21 16:04:53 +0900313 // b/149353192: when a module is instrumented, jacoco adds synthetic members
314 // $jacocoData and $jacocoInit. Since they don't exist when building the hidden API flags,
315 // don't complain when we don't find hidden API flags for the synthetic members.
Paul Duffinc495d2b2020-05-19 21:07:52 +0100316 if j, ok := ctx.Module().(interface {
317 shouldInstrument(android.BaseModuleContext) bool
318 }); ok && j.shouldInstrument(ctx) {
Jiyong Park93e57a02020-02-21 16:04:53 +0900319 enforceHiddenApiFlagsToAllMembers = false
320 }
321
322 if !enforceHiddenApiFlagsToAllMembers {
David Brazdil91b4e3e2019-01-23 21:04:05 +0000323 hiddenapiFlags = "--no-force-assign-all"
324 }
Colin Crosscd964b32019-01-18 22:03:02 -0800325
Colin Cross8faf8fc2019-01-16 15:15:52 -0800326 ctx.Build(pctx, android.BuildParams{
327 Rule: hiddenAPIEncodeDexRule,
328 Description: "hiddenapi encode dex",
329 Input: dexInput,
Nicolas Geoffray65fd8ba2019-01-21 23:20:23 +0000330 Output: tmpOutput,
Colin Crossf24a22a2019-01-31 14:12:44 -0800331 Implicit: flagsCSV,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800332 Args: map[string]string{
Colin Crossf24a22a2019-01-31 14:12:44 -0800333 "flagsCsv": flagsCSV.String(),
David Brazdil91b4e3e2019-01-23 21:04:05 +0000334 "tmpDir": tmpDir.String(),
335 "soongZipFlags": soongZipFlags,
336 "hiddenapiFlags": hiddenapiFlags,
Colin Cross8faf8fc2019-01-16 15:15:52 -0800337 },
338 })
339
Nicolas Geoffray65fd8ba2019-01-21 23:20:23 +0000340 if uncompressDex {
341 TransformZipAlign(ctx, output, tmpOutput)
342 }
Colin Cross8faf8fc2019-01-16 15:15:52 -0800343}
Paul Duffin031d8692021-02-12 11:46:42 +0000344
345type hiddenApiAnnotationsDependencyTag struct {
346 blueprint.BaseDependencyTag
347}
348
349// Tag used to mark dependencies on java_library instances that contains Java source files whose
350// sole purpose is to provide additional hiddenapi annotations.
351var hiddenApiAnnotationsTag hiddenApiAnnotationsDependencyTag
352
353// Mark this tag so dependencies that use it are excluded from APEX contents.
354func (t hiddenApiAnnotationsDependencyTag) ExcludeFromApexContents() {}
355
356var _ android.ExcludeFromApexContentsTag = hiddenApiAnnotationsTag