Rename CommonModuleInfoKey to be consistent with others.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I1ce8bc782666586633ded9cfaf1b9590e3c0efde
diff --git a/java/app.go b/java/app.go
index 65ccc68..3fab891 100644
--- a/java/app.go
+++ b/java/app.go
@@ -531,7 +531,7 @@
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 @@
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 @@
}
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 @@
// 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 @@
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 0833831..19fb2bc 100644
--- a/java/base.go
+++ b/java/base.go
@@ -629,7 +629,7 @@
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 215fbbd..235a27d 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2225,7 +2225,7 @@
// 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 4711dc1..7ef6c89 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -46,7 +46,7 @@
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 c31dfd0..61b50dc 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -659,7 +659,7 @@
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 ab4f8f8..b2d6ca1 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -277,7 +277,7 @@
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 {