From ef9e63e775493bd73cb28917ad59e6b10e5506b5 Mon Sep 17 00:00:00 2001 From: Yu Liu Date: Tue, 4 Mar 2025 19:01:28 +0000 Subject: Rename CommonModuleInfoKey to be consistent with others. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I1ce8bc782666586633ded9cfaf1b9590e3c0efde --- java/app.go | 10 +++++----- java/base.go | 2 +- java/java.go | 2 +- java/jdeps.go | 2 +- java/lint.go | 2 +- java/platform_compat_config.go | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'java') diff --git a/java/app.go b/java/app.go index 65ccc686c..3fab89119 100644 --- a/java/app.go +++ b/java/app.go @@ -531,7 +531,7 @@ func (a *AndroidApp) checkJniLibsSdkVersion(ctx android.ModuleContext, minSdkVer if _, ok := android.OtherModuleProvider(ctx, m, cc.CcInfoProvider); !ok { panic(fmt.Errorf("jni dependency is not a cc module: %v", m)) } - commonInfo, ok := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoKey) + commonInfo, ok := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoProvider) if !ok { panic(fmt.Errorf("jni dependency doesn't have CommonModuleInfo provider: %v", m)) } @@ -1229,7 +1229,7 @@ func collectJniDeps(ctx android.ModuleContext, seenModulePaths := make(map[string]bool) ctx.WalkDepsProxy(func(module, parent android.ModuleProxy) bool { - if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled { + if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled { return false } otherName := ctx.OtherModuleName(module) @@ -1249,7 +1249,7 @@ func collectJniDeps(ctx android.ModuleContext, } seenModulePaths[path.String()] = true - commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey) + commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider) if checkNativeSdkVersion && commonInfo.SdkVersion == "" { ctx.PropertyErrorf("jni_libs", "JNI dependency %q uses platform APIs, but this module does not", otherName) @@ -1312,7 +1312,7 @@ func (a *AndroidApp) buildAppDependencyInfo(ctx android.ModuleContext) { // Skip dependencies that are only available to APEXes; they are developed with updatability // in mind and don't need manual approval. - if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoKey).NotAvailableForPlatform { + if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoProvider).NotAvailableForPlatform { return true } @@ -1322,7 +1322,7 @@ func (a *AndroidApp) buildAppDependencyInfo(ctx android.ModuleContext) { depsInfo[depName] = info } else { toMinSdkVersion := "(no version)" - if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok && + if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoProvider); ok && !info.MinSdkVersion.IsPlatform && info.MinSdkVersion.ApiLevel != nil { toMinSdkVersion = info.MinSdkVersion.ApiLevel.String() } diff --git a/java/base.go b/java/base.go index 0833831fc..19fb2bcf2 100644 --- a/java/base.go +++ b/java/base.go @@ -629,7 +629,7 @@ func CheckStableSdkVersion(ctx android.BaseModuleContext, module android.ModuleP return nil } if info.SdkVersion.Kind == android.SdkCorePlatform { - if useLegacyCorePlatformApi(ctx, android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).BaseModuleName) { + if useLegacyCorePlatformApi(ctx, android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).BaseModuleName) { return fmt.Errorf("non stable SDK %v - uses legacy core platform", info.SdkVersion) } else { // Treat stable core platform as stable. diff --git a/java/java.go b/java/java.go index 215fbbda8..235a27d4c 100644 --- a/java/java.go +++ b/java/java.go @@ -2225,7 +2225,7 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) { // install these alongside the java binary. ctx.VisitDirectDepsProxyWithTag(jniInstallTag, func(jni android.ModuleProxy) { // Use the BaseModuleName of the dependency (without any prebuilt_ prefix) - commonInfo, _ := android.OtherModuleProvider(ctx, jni, android.CommonModuleInfoKey) + commonInfo, _ := android.OtherModuleProvider(ctx, jni, android.CommonModuleInfoProvider) j.androidMkNamesOfJniLibs = append(j.androidMkNamesOfJniLibs, commonInfo.BaseModuleName+":"+commonInfo.Target.Arch.ArchType.Bitness()) }) // Check that native libraries are not listed in `required`. Prompt users to use `jni_libs` instead. diff --git a/java/jdeps.go b/java/jdeps.go index 4711dc1a4..7ef6c89ee 100644 --- a/java/jdeps.go +++ b/java/jdeps.go @@ -46,7 +46,7 @@ func (j *jdepsGeneratorSingleton) GenerateBuildActions(ctx android.SingletonCont moduleInfos := make(map[string]android.IdeInfo) ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { - if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled { + if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled { return } diff --git a/java/lint.go b/java/lint.go index c31dfd005..61b50dcba 100644 --- a/java/lint.go +++ b/java/lint.go @@ -659,7 +659,7 @@ func (l *lintSingleton) generateLintReportZips(ctx android.SingletonContext) { var outputs []*LintInfo var dirs []string ctx.VisitAllModuleProxies(func(m android.ModuleProxy) { - commonInfo, _ := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoKey) + commonInfo, _ := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoProvider) if ctx.Config().KatiEnabled() && !commonInfo.ExportedToMake { return } diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go index ab4f8f81f..b2d6ca130 100644 --- a/java/platform_compat_config.go +++ b/java/platform_compat_config.go @@ -277,7 +277,7 @@ func (p *platformCompatConfigSingleton) GenerateBuildActions(ctx android.Singlet var compatConfigMetadata android.Paths ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { - if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled { + if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled { return } if c, ok := android.OtherModuleProvider(ctx, module, PlatformCompatConfigMetadataInfoProvider); ok { -- cgit v1.2.3-59-g8ed1b