blob: 61a9b97e43a484f3a74e29ce71ac139759d7dc4e [file] [log] [blame]
Colin Crossf24a22a2019-01-31 14:12:44 -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 (
Paul Duffin1b033f52019-06-10 14:15:04 +010018 "fmt"
19
Colin Crossf24a22a2019-01-31 14:12:44 -080020 "android/soong/android"
21)
22
23func init() {
24 android.RegisterSingletonType("hiddenapi", hiddenAPISingletonFactory)
Artur Satayevb5df8a02020-02-19 16:39:59 +000025 android.RegisterSingletonType("hiddenapi_index", hiddenAPIIndexSingletonFactory)
Paul Duffin1b033f52019-06-10 14:15:04 +010026 android.RegisterModuleType("hiddenapi_flags", hiddenAPIFlagsFactory)
Colin Crossf24a22a2019-01-31 14:12:44 -080027}
28
29type hiddenAPISingletonPathsStruct struct {
Colin Crossf24a22a2019-01-31 14:12:44 -080030 flags android.OutputPath
Artur Satayevb5df8a02020-02-19 16:39:59 +000031 index android.OutputPath
Colin Crossf24a22a2019-01-31 14:12:44 -080032 metadata android.OutputPath
Artur Satayevb5df8a02020-02-19 16:39:59 +000033 stubFlags android.OutputPath
Colin Crossf24a22a2019-01-31 14:12:44 -080034}
35
36var hiddenAPISingletonPathsKey = android.NewOnceKey("hiddenAPISingletonPathsKey")
37
38// hiddenAPISingletonPaths creates all the paths for singleton files the first time it is called, which may be
39// from a ModuleContext that needs to reference a file that will be created by a singleton rule that hasn't
40// yet been created.
41func hiddenAPISingletonPaths(ctx android.PathContext) hiddenAPISingletonPathsStruct {
42 return ctx.Config().Once(hiddenAPISingletonPathsKey, func() interface{} {
43 return hiddenAPISingletonPathsStruct{
Colin Crossf24a22a2019-01-31 14:12:44 -080044 flags: android.PathForOutput(ctx, "hiddenapi", "hiddenapi-flags.csv"),
Artur Satayevb5df8a02020-02-19 16:39:59 +000045 index: android.PathForOutput(ctx, "hiddenapi", "hiddenapi-index.csv"),
Andrei Onea47841972020-08-10 17:23:52 +010046 metadata: android.PathForOutput(ctx, "hiddenapi", "hiddenapi-unsupported.csv"),
Artur Satayevb5df8a02020-02-19 16:39:59 +000047 stubFlags: android.PathForOutput(ctx, "hiddenapi", "hiddenapi-stub-flags.txt"),
Colin Crossf24a22a2019-01-31 14:12:44 -080048 }
49 }).(hiddenAPISingletonPathsStruct)
50}
51
Colin Crossf24a22a2019-01-31 14:12:44 -080052func hiddenAPISingletonFactory() android.Singleton {
Colin Crossed023ec2019-02-19 12:38:45 -080053 return &hiddenAPISingleton{}
Colin Crossf24a22a2019-01-31 14:12:44 -080054}
55
Colin Crossed023ec2019-02-19 12:38:45 -080056type hiddenAPISingleton struct {
57 flags, metadata android.Path
58}
Colin Crossf24a22a2019-01-31 14:12:44 -080059
60// hiddenAPI singleton rules
Colin Crossed023ec2019-02-19 12:38:45 -080061func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext) {
Colin Crossf24a22a2019-01-31 14:12:44 -080062 // Don't run any hiddenapi rules if UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
63 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
64 return
65 }
66
67 stubFlagsRule(ctx)
68
69 // These rules depend on files located in frameworks/base, skip them if running in a tree that doesn't have them.
Jiyong Park09cb6292019-07-15 15:29:23 +090070 if ctx.Config().FrameworksBaseDirExists(ctx) {
Colin Crossed023ec2019-02-19 12:38:45 -080071 h.flags = flagsRule(ctx)
72 h.metadata = metadataRule(ctx)
Colin Crossf24a22a2019-01-31 14:12:44 -080073 } else {
Colin Crossed023ec2019-02-19 12:38:45 -080074 h.flags = emptyFlagsRule(ctx)
75 }
76}
77
78// Export paths to Make. INTERNAL_PLATFORM_HIDDENAPI_FLAGS is used by Make rules in art/ and cts/.
79// Both paths are used to call dist-for-goals.
80func (h *hiddenAPISingleton) MakeVars(ctx android.MakeVarsContext) {
81 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
82 return
83 }
84
85 ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", h.flags.String())
86
87 if h.metadata != nil {
88 ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA", h.metadata.String())
Colin Crossf24a22a2019-01-31 14:12:44 -080089 }
90}
91
92// stubFlagsRule creates the rule to build hiddenapi-stub-flags.txt out of dex jars from stub modules and boot image
93// modules.
94func stubFlagsRule(ctx android.SingletonContext) {
Anton Hanssona2adc372020-07-03 15:31:32 +010095 var publicStubModules []string
96 var systemStubModules []string
97 var testStubModules []string
98 var corePlatformStubModules []string
99
100 if ctx.Config().AlwaysUsePrebuiltSdks() {
101 // Build configuration mandates using prebuilt stub modules
102 publicStubModules = append(publicStubModules, "sdk_public_current_android")
103 systemStubModules = append(systemStubModules, "sdk_system_current_android")
104 testStubModules = append(testStubModules, "sdk_test_current_android")
105 } else {
106 // Use stub modules built from source
107 publicStubModules = append(publicStubModules, "android_stubs_current")
108 systemStubModules = append(systemStubModules, "android_system_stubs_current")
109 testStubModules = append(testStubModules, "android_test_stubs_current")
Paul Duffin719fed42019-02-28 16:15:44 +0000110 }
Anton Hanssona2adc372020-07-03 15:31:32 +0100111 // We do not have prebuilts of the core platform api yet
112 corePlatformStubModules = append(corePlatformStubModules, "legacy.core.platform.api.stubs")
Paul Duffin719fed42019-02-28 16:15:44 +0000113
114 // Add the android.test.base to the set of stubs only if the android.test.base module is on
115 // the boot jars list as the runtime will only enforce hiddenapi access against modules on
116 // that list.
Anton Hanssona2adc372020-07-03 15:31:32 +0100117 if inList("android.test.base", ctx.Config().BootJars()) {
118 if ctx.Config().AlwaysUsePrebuiltSdks() {
119 publicStubModules = append(publicStubModules, "sdk_public_current_android.test.base")
120 } else {
121 publicStubModules = append(publicStubModules, "android.test.base.stubs")
122 }
Colin Crossf24a22a2019-01-31 14:12:44 -0800123 }
124
125 // Allow products to define their own stubs for custom product jars that apps can use.
126 publicStubModules = append(publicStubModules, ctx.Config().ProductHiddenAPIStubs()...)
127 systemStubModules = append(systemStubModules, ctx.Config().ProductHiddenAPIStubsSystem()...)
128 testStubModules = append(testStubModules, ctx.Config().ProductHiddenAPIStubsTest()...)
Allen Hairde816cf2019-02-25 16:37:42 -0800129 if ctx.Config().IsEnvTrue("EMMA_INSTRUMENT") {
130 publicStubModules = append(publicStubModules, "jacoco-stubs")
131 }
Colin Crossf24a22a2019-01-31 14:12:44 -0800132
133 publicStubPaths := make(android.Paths, len(publicStubModules))
134 systemStubPaths := make(android.Paths, len(systemStubModules))
135 testStubPaths := make(android.Paths, len(testStubModules))
136 corePlatformStubPaths := make(android.Paths, len(corePlatformStubModules))
137
138 moduleListToPathList := map[*[]string]android.Paths{
139 &publicStubModules: publicStubPaths,
140 &systemStubModules: systemStubPaths,
141 &testStubModules: testStubPaths,
142 &corePlatformStubModules: corePlatformStubPaths,
143 }
144
145 var bootDexJars android.Paths
146
147 ctx.VisitAllModules(func(module android.Module) {
148 // Collect dex jar paths for the modules listed above.
149 if j, ok := module.(Dependency); ok {
150 name := ctx.ModuleName(module)
151 for moduleList, pathList := range moduleListToPathList {
152 if i := android.IndexList(name, *moduleList); i != -1 {
Ulyana Trafimovich5539e7b2020-06-04 14:08:17 +0000153 pathList[i] = j.DexJarBuildPath()
Colin Crossf24a22a2019-01-31 14:12:44 -0800154 }
155 }
156 }
157
158 // Collect dex jar paths for modules that had hiddenapi encode called on them.
159 if h, ok := module.(hiddenAPIIntf); ok {
160 if jar := h.bootDexJar(); jar != nil {
Jiyong Park4ed468c2019-12-19 02:11:10 +0000161 // For a java lib included in an APEX, only take the one built for
162 // the platform variant, and skip the variants for APEXes.
163 // Otherwise, the hiddenapi tool will complain about duplicated classes
164 if a, ok := module.(android.ApexModule); ok {
165 if android.InAnyApex(module.Name()) && !a.IsForPlatform() {
Jiyong Park7f7766d2019-07-25 22:02:35 +0900166 return
167 }
168 }
Liz Kammer5ca3a622020-08-05 15:40:41 -0700169
Colin Crossf24a22a2019-01-31 14:12:44 -0800170 bootDexJars = append(bootDexJars, jar)
171 }
172 }
173 })
174
175 var missingDeps []string
176 // Ensure all modules were converted to paths
177 for moduleList, pathList := range moduleListToPathList {
178 for i := range pathList {
179 if pathList[i] == nil {
Colin Crosscaa0e1e2019-04-02 13:03:46 -0700180 pathList[i] = android.PathForOutput(ctx, "missing")
Colin Crossf24a22a2019-01-31 14:12:44 -0800181 if ctx.Config().AllowMissingDependencies() {
182 missingDeps = append(missingDeps, (*moduleList)[i])
Colin Crossf24a22a2019-01-31 14:12:44 -0800183 } else {
184 ctx.Errorf("failed to find dex jar path for module %q",
185 (*moduleList)[i])
186 }
187 }
188 }
189 }
190
191 // Singleton rule which applies hiddenapi on all boot class path dex files.
192 rule := android.NewRuleBuilder()
193
194 outputPath := hiddenAPISingletonPaths(ctx).stubFlags
195 tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp")
196
197 rule.MissingDeps(missingDeps)
198
199 rule.Command().
Martin Stjernholm7260d062019-12-09 21:47:14 +0000200 Tool(ctx.Config().HostToolPath(ctx, "hiddenapi")).
Colin Crossf24a22a2019-01-31 14:12:44 -0800201 Text("list").
Colin Cross69f59a32019-02-15 10:39:37 -0800202 FlagForEachInput("--boot-dex=", bootDexJars).
203 FlagWithInputList("--public-stub-classpath=", publicStubPaths, ":").
Andrei Oneae04da072019-03-01 17:44:13 +0000204 FlagWithInputList("--system-stub-classpath=", systemStubPaths, ":").
205 FlagWithInputList("--test-stub-classpath=", testStubPaths, ":").
Colin Cross69f59a32019-02-15 10:39:37 -0800206 FlagWithInputList("--core-platform-stub-classpath=", corePlatformStubPaths, ":").
207 FlagWithOutput("--out-api-flags=", tempPath)
Colin Crossf24a22a2019-01-31 14:12:44 -0800208
209 commitChangeForRestat(rule, tempPath, outputPath)
210
211 rule.Build(pctx, ctx, "hiddenAPIStubFlagsFile", "hiddenapi stub flags")
212}
213
Eric Jeong9791efa2020-06-04 17:56:18 -0700214func moduleForGreyListRemovedApis(ctx android.SingletonContext, module android.Module) bool {
215 switch ctx.ModuleName(module) {
216 case "api-stubs-docs", "system-api-stubs-docs", "android.car-stubs-docs", "android.car-system-stubs-docs":
217 return true
218 default:
219 return false
220 }
221}
222
Colin Crossf24a22a2019-01-31 14:12:44 -0800223// flagsRule creates a rule to build hiddenapi-flags.csv out of flags.csv files generated for boot image modules and
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000224// the unsupported API.
Colin Crossed023ec2019-02-19 12:38:45 -0800225func flagsRule(ctx android.SingletonContext) android.Path {
Colin Crossf24a22a2019-01-31 14:12:44 -0800226 var flagsCSV android.Paths
Artur Satayevc7fb5c92020-03-25 16:48:49 +0000227 var greylistRemovedApis android.Paths
Colin Crossf24a22a2019-01-31 14:12:44 -0800228
229 ctx.VisitAllModules(func(module android.Module) {
230 if h, ok := module.(hiddenAPIIntf); ok {
231 if csv := h.flagsCSV(); csv != nil {
232 flagsCSV = append(flagsCSV, csv)
233 }
Artur Satayevc7fb5c92020-03-25 16:48:49 +0000234 } else if ds, ok := module.(*Droidstubs); ok {
235 // Track @removed public and system APIs via corresponding droidstubs targets.
236 // These APIs are not present in the stubs, however, we have to keep allowing access
237 // to them at runtime.
Eric Jeong9791efa2020-06-04 17:56:18 -0700238 if moduleForGreyListRemovedApis(ctx, module) {
Artur Satayevc7fb5c92020-03-25 16:48:49 +0000239 greylistRemovedApis = append(greylistRemovedApis, ds.removedDexApiFile)
240 }
Colin Crossf24a22a2019-01-31 14:12:44 -0800241 }
242 })
243
Artur Satayevc7fb5c92020-03-25 16:48:49 +0000244 combinedRemovedApis := android.PathForOutput(ctx, "hiddenapi", "combined-removed-dex.txt")
245 ctx.Build(pctx, android.BuildParams{
246 Rule: android.Cat,
247 Inputs: greylistRemovedApis,
248 Output: combinedRemovedApis,
249 Description: "Combine removed apis for " + combinedRemovedApis.String(),
250 })
Colin Crossf24a22a2019-01-31 14:12:44 -0800251
252 rule := android.NewRuleBuilder()
253
254 outputPath := hiddenAPISingletonPaths(ctx).flags
255 tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp")
256
257 stubFlags := hiddenAPISingletonPaths(ctx).stubFlags
258
259 rule.Command().
Colin Cross69f59a32019-02-15 10:39:37 -0800260 Tool(android.PathForSource(ctx, "frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py")).
261 FlagWithInput("--csv ", stubFlags).
262 Inputs(flagsCSV).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000263 FlagWithInput("--unsupported ",
Andrei Oneaca790812020-08-04 15:34:35 +0100264 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-unsupported.txt")).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000265 FlagWithInput("--unsupported-ignore-conflicts ", combinedRemovedApis).
266 FlagWithInput("--max-target-q ",
Andrei Oneaca790812020-08-04 15:34:35 +0100267 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-q.txt")).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000268 FlagWithInput("--max-target-p ",
Andrei Oneaca790812020-08-04 15:34:35 +0100269 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-p.txt")).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000270 FlagWithInput("--max-target-o-ignore-conflicts ",
Andrei Oneaca790812020-08-04 15:34:35 +0100271 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-o.txt")).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000272 FlagWithInput("--blocked ",
Andrei Oneaca790812020-08-04 15:34:35 +0100273 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-force-blocked.txt")).
Aleksei Kalinovf0f5cdc2020-07-28 13:44:24 +0000274 FlagWithInput("--unsupported-packages ",
Andrei Oneaca790812020-08-04 15:34:35 +0100275 android.PathForSource(ctx, "frameworks/base/config/hiddenapi-unsupported-packages.txt")).
Colin Cross69f59a32019-02-15 10:39:37 -0800276 FlagWithOutput("--output ", tempPath)
Colin Crossf24a22a2019-01-31 14:12:44 -0800277
278 commitChangeForRestat(rule, tempPath, outputPath)
279
280 rule.Build(pctx, ctx, "hiddenAPIFlagsFile", "hiddenapi flags")
Colin Crossed023ec2019-02-19 12:38:45 -0800281
282 return outputPath
Colin Crossf24a22a2019-01-31 14:12:44 -0800283}
284
285// emptyFlagsRule creates a rule to build an empty hiddenapi-flags.csv, which is needed by master-art-host builds that
286// have a partial manifest without frameworks/base but still need to build a boot image.
Colin Crossed023ec2019-02-19 12:38:45 -0800287func emptyFlagsRule(ctx android.SingletonContext) android.Path {
Colin Crossf24a22a2019-01-31 14:12:44 -0800288 rule := android.NewRuleBuilder()
289
290 outputPath := hiddenAPISingletonPaths(ctx).flags
291
Colin Cross69f59a32019-02-15 10:39:37 -0800292 rule.Command().Text("rm").Flag("-f").Output(outputPath)
293 rule.Command().Text("touch").Output(outputPath)
Colin Crossf24a22a2019-01-31 14:12:44 -0800294
295 rule.Build(pctx, ctx, "emptyHiddenAPIFlagsFile", "empty hiddenapi flags")
Colin Crossed023ec2019-02-19 12:38:45 -0800296
297 return outputPath
Colin Crossf24a22a2019-01-31 14:12:44 -0800298}
299
Andrei Onea47841972020-08-10 17:23:52 +0100300// metadataRule creates a rule to build hiddenapi-unsupported.csv out of the metadata.csv files generated for boot image
Colin Crossf24a22a2019-01-31 14:12:44 -0800301// modules.
Colin Crossed023ec2019-02-19 12:38:45 -0800302func metadataRule(ctx android.SingletonContext) android.Path {
Colin Crossf24a22a2019-01-31 14:12:44 -0800303 var metadataCSV android.Paths
304
305 ctx.VisitAllModules(func(module android.Module) {
306 if h, ok := module.(hiddenAPIIntf); ok {
307 if csv := h.metadataCSV(); csv != nil {
308 metadataCSV = append(metadataCSV, csv)
309 }
310 }
311 })
312
313 rule := android.NewRuleBuilder()
314
315 outputPath := hiddenAPISingletonPaths(ctx).metadata
316
317 rule.Command().
Artur Satayevb01dd442020-01-20 17:53:31 +0000318 BuiltTool(ctx, "merge_csv").
Artur Satayev79fac052020-01-20 19:11:33 +0000319 FlagWithOutput("--output=", outputPath).
320 Inputs(metadataCSV)
Colin Crossf24a22a2019-01-31 14:12:44 -0800321
322 rule.Build(pctx, ctx, "hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata")
Colin Crossed023ec2019-02-19 12:38:45 -0800323
324 return outputPath
Colin Crossf24a22a2019-01-31 14:12:44 -0800325}
326
327// commitChangeForRestat adds a command to a rule that updates outputPath from tempPath if they are different. It
328// also marks the rule as restat and marks the tempPath as a temporary file that should not be considered an output of
329// the rule.
330func commitChangeForRestat(rule *android.RuleBuilder, tempPath, outputPath android.WritablePath) {
331 rule.Restat()
Colin Cross69f59a32019-02-15 10:39:37 -0800332 rule.Temporary(tempPath)
Colin Crossf24a22a2019-01-31 14:12:44 -0800333 rule.Command().
334 Text("(").
335 Text("if").
Colin Cross69f59a32019-02-15 10:39:37 -0800336 Text("cmp -s").Input(tempPath).Output(outputPath).Text(";").
Colin Crossf24a22a2019-01-31 14:12:44 -0800337 Text("then").
Colin Cross69f59a32019-02-15 10:39:37 -0800338 Text("rm").Input(tempPath).Text(";").
Colin Crossf24a22a2019-01-31 14:12:44 -0800339 Text("else").
Colin Cross69f59a32019-02-15 10:39:37 -0800340 Text("mv").Input(tempPath).Output(outputPath).Text(";").
Colin Crossf24a22a2019-01-31 14:12:44 -0800341 Text("fi").
342 Text(")")
343}
Paul Duffin1b033f52019-06-10 14:15:04 +0100344
345type hiddenAPIFlagsProperties struct {
346 // name of the file into which the flags will be copied.
347 Filename *string
348}
349
350type hiddenAPIFlags struct {
351 android.ModuleBase
352
353 properties hiddenAPIFlagsProperties
354
355 outputFilePath android.OutputPath
356}
357
358func (h *hiddenAPIFlags) GenerateAndroidBuildActions(ctx android.ModuleContext) {
359 filename := String(h.properties.Filename)
360
361 inputPath := hiddenAPISingletonPaths(ctx).flags
362 h.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath
363
364 // This ensures that outputFilePath has the correct name for others to
365 // use, as the source file may have a different name.
366 ctx.Build(pctx, android.BuildParams{
367 Rule: android.Cp,
368 Output: h.outputFilePath,
369 Input: inputPath,
370 })
371}
372
373func (h *hiddenAPIFlags) OutputFiles(tag string) (android.Paths, error) {
374 switch tag {
375 case "":
376 return android.Paths{h.outputFilePath}, nil
377 default:
378 return nil, fmt.Errorf("unsupported module reference tag %q", tag)
379 }
380}
381
382// hiddenapi-flags provides access to the hiddenapi-flags.csv file generated during the build.
383func hiddenAPIFlagsFactory() android.Module {
384 module := &hiddenAPIFlags{}
385 module.AddProperties(&module.properties)
386 android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
387 return module
388}
Artur Satayevb5df8a02020-02-19 16:39:59 +0000389
390func hiddenAPIIndexSingletonFactory() android.Singleton {
391 return &hiddenAPIIndexSingleton{}
392}
393
394type hiddenAPIIndexSingleton struct {
395 index android.Path
396}
397
398func (h *hiddenAPIIndexSingleton) GenerateBuildActions(ctx android.SingletonContext) {
399 // Don't run any hiddenapi rules if UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
400 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
401 return
402 }
403
404 indexes := android.Paths{}
405 ctx.VisitAllModules(func(module android.Module) {
406 if h, ok := module.(hiddenAPIIntf); ok {
407 if h.indexCSV() != nil {
408 indexes = append(indexes, h.indexCSV())
409 }
410 }
411 })
412
413 rule := android.NewRuleBuilder()
414 rule.Command().
415 BuiltTool(ctx, "merge_csv").
416 FlagWithArg("--header=", "signature,file,startline,startcol,endline,endcol,properties").
417 FlagWithOutput("--output=", hiddenAPISingletonPaths(ctx).index).
418 Inputs(indexes)
419 rule.Build(pctx, ctx, "singleton-merged-hiddenapi-index", "Singleton merged Hidden API index")
420
421 h.index = hiddenAPISingletonPaths(ctx).index
422}
423
424func (h *hiddenAPIIndexSingleton) MakeVars(ctx android.MakeVarsContext) {
425 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
426 return
427 }
428
429 ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_INDEX", h.index.String())
430}