Replace usages of SdkAware in sdk module with Module
Previously, the sdk snapshot code used SdkAware instead of Module to
ensure that all its members had implemented SdkAware. However, it never
used any of the methods provided by SdkAware, or if it did it no longer
does. So, this change replaces usages of SdkAware with Module in
preparation for deleting it completely.
Bug: 260237150
Test: m nothing
Change-Id: Ia89e02394f27b2da776f0cf0f0bc86835a03433a
diff --git a/sdk/update.go b/sdk/update.go
index baa2033..f50439c 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -171,9 +171,9 @@
exportedComponentsInfo = ctx.OtherModuleProvider(child, android.ExportedComponentsInfoProvider).(android.ExportedComponentsInfo)
}
- var container android.SdkAware
+ var container android.Module
if parent != ctx.Module() {
- container = parent.(android.SdkAware)
+ container = parent.(android.Module)
}
minApiLevel := android.MinApiLevelForSdkSnapshot(ctx, child)
@@ -182,7 +182,7 @@
s.memberVariantDeps = append(s.memberVariantDeps, sdkMemberVariantDep{
sdkVariant: s,
memberType: memberType,
- variant: child.(android.SdkAware),
+ variant: child.(android.Module),
minApiLevel: minApiLevel,
container: container,
export: export,
@@ -269,7 +269,7 @@
return supportedByTargetBuildRelease
}
-func appendUniqueVariants(variants []android.SdkAware, newVariant android.SdkAware) []android.SdkAware {
+func appendUniqueVariants(variants []android.Module, newVariant android.Module) []android.Module {
for _, v := range variants {
if v == newVariant {
return variants
@@ -1246,12 +1246,12 @@
memberType android.SdkMemberType
// The variant that is added to the sdk.
- variant android.SdkAware
+ variant android.Module
// The optional container of this member, i.e. the module that is depended upon by the sdk
// (possibly transitively) and whose dependency on this module is why it was added to the sdk.
// Is nil if this a direct dependency of the sdk.
- container android.SdkAware
+ container android.Module
// True if the member should be exported, i.e. accessible, from outside the sdk.
export bool
@@ -1270,14 +1270,14 @@
type sdkMember struct {
memberType android.SdkMemberType
name string
- variants []android.SdkAware
+ variants []android.Module
}
func (m *sdkMember) Name() string {
return m.name
}
-func (m *sdkMember) Variants() []android.SdkAware {
+func (m *sdkMember) Variants() []android.Module {
return m.variants
}
@@ -1362,24 +1362,24 @@
// by apex variant, where one is the default/platform variant and one is the APEX variant. In that
// case it picks the APEX variant. It picks the APEX variant because that is the behavior that would
// be expected
-func selectApexVariantsWhereAvailable(ctx *memberContext, variants []android.SdkAware) []android.SdkAware {
+func selectApexVariantsWhereAvailable(ctx *memberContext, variants []android.Module) []android.Module {
moduleCtx := ctx.sdkMemberContext
// Group the variants by coordinates.
- variantsByCoord := make(map[variantCoordinate][]android.SdkAware)
+ variantsByCoord := make(map[variantCoordinate][]android.Module)
for _, variant := range variants {
coord := getVariantCoordinate(ctx, variant)
variantsByCoord[coord] = append(variantsByCoord[coord], variant)
}
- toDiscard := make(map[android.SdkAware]struct{})
+ toDiscard := make(map[android.Module]struct{})
for coord, list := range variantsByCoord {
count := len(list)
if count == 1 {
continue
}
- variantsByApex := make(map[string]android.SdkAware)
+ variantsByApex := make(map[string]android.Module)
conflictDetected := false
for _, variant := range list {
apexInfo := moduleCtx.OtherModuleProvider(variant, android.ApexInfoProvider).(android.ApexInfo)
@@ -1421,7 +1421,7 @@
// If there are any variants to discard then remove them from the list of variants, while
// preserving the order.
if len(toDiscard) > 0 {
- filtered := []android.SdkAware{}
+ filtered := []android.Module{}
for _, variant := range variants {
if _, ok := toDiscard[variant]; !ok {
filtered = append(filtered, variant)