diff options
Diffstat (limited to 'java')
| -rw-r--r-- | java/hiddenapi_singleton.go | 15 | ||||
| -rw-r--r-- | java/support_libraries.go | 9 |
2 files changed, 5 insertions, 19 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go index d43e276ac..de1bcf506 100644 --- a/java/hiddenapi_singleton.go +++ b/java/hiddenapi_singleton.go @@ -19,7 +19,6 @@ import ( ) func init() { - android.RegisterPreSingletonType("pre-hiddenapi", hiddenAPIPreSingletonFactory) android.RegisterSingletonType("hiddenapi", hiddenAPISingletonFactory) } @@ -44,18 +43,6 @@ func hiddenAPISingletonPaths(ctx android.PathContext) hiddenAPISingletonPathsStr }).(hiddenAPISingletonPathsStruct) } -func hiddenAPIPreSingletonFactory() android.Singleton { - return hiddenAPIPreSingleton{} -} - -type hiddenAPIPreSingleton struct{} - -// hiddenAPI pre-singleton rules to ensure paths are always generated before -// makevars -func (hiddenAPIPreSingleton) GenerateBuildActions(ctx android.SingletonContext) { - hiddenAPISingletonPaths(ctx) -} - func hiddenAPISingletonFactory() android.Singleton { return hiddenAPISingleton{} } @@ -296,7 +283,7 @@ func init() { // Both paths are used to call dist-for-goals. func hiddenAPIMakeVars(ctx android.MakeVarsContext) { if !ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") { - singletonPaths := ctx.Config().Get(hiddenAPISingletonPathsKey).(hiddenAPISingletonPathsStruct) + singletonPaths := hiddenAPISingletonPaths(ctx) ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", singletonPaths.flags.String()) ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA", singletonPaths.metadata.String()) } diff --git a/java/support_libraries.go b/java/support_libraries.go index 320afae19..5a72f41a9 100644 --- a/java/support_libraries.go +++ b/java/support_libraries.go @@ -28,9 +28,8 @@ func init() { func supportLibrariesMakeVarsProvider(ctx android.MakeVarsContext) { var supportAars, supportJars []string - sctx := ctx.SingletonContext() - sctx.VisitAllModules(func(module android.Module) { - dir := sctx.ModuleDir(module) + ctx.VisitAllModules(func(module android.Module) { + dir := ctx.ModuleDir(module) switch { case strings.HasPrefix(dir, "prebuilts/sdk/current/extras"), dir == "prebuilts/sdk/current/androidx", @@ -43,7 +42,7 @@ func supportLibrariesMakeVarsProvider(ctx android.MakeVarsContext) { return } - name := sctx.ModuleName(module) + name := ctx.ModuleName(module) if strings.HasSuffix(name, "-nodeps") { return } @@ -54,7 +53,7 @@ func supportLibrariesMakeVarsProvider(ctx android.MakeVarsContext) { case *Library, *Import: supportJars = append(supportJars, name) default: - sctx.ModuleErrorf(module, "unknown module type %t", module) + ctx.ModuleErrorf(module, "unknown module type %t", module) } }) |