summaryrefslogtreecommitdiff
path: root/rust/rust.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 4fd800282..713cacc79 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -841,7 +841,7 @@ func (mod *Module) getSharedFlags() *cc.SharedFlags {
return shared
}
-func (mod *Module) ImplementationModuleNameForMake(ctx android.BaseModuleContext) string {
+func (mod *Module) ImplementationModuleNameForMake() string {
name := mod.BaseModuleName()
if versioned, ok := mod.compiler.(cc.VersionedInterface); ok {
name = versioned.ImplementationModuleName(name)
@@ -1411,7 +1411,7 @@ func rustMakeLibName(rustInfo *RustInfo, linkableInfo *cc.LinkableInfo, commonIn
if rustInfo != nil {
// Use base module name for snapshots when exporting to Makefile.
if rustInfo.SnapshotInfo != nil {
- baseName := linkableInfo.BaseModuleName
+ baseName := commonInfo.BaseModuleName
return baseName + rustInfo.SnapshotInfo.SnapshotAndroidMkSuffix + rustInfo.AndroidMkSuffix
}
}
@@ -2085,26 +2085,23 @@ func (mod *Module) MinSdkVersion() string {
}
// Implements android.ApexModule
-func (mod *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion android.ApiLevel) error {
+func (mod *Module) MinSdkVersionSupported(ctx android.BaseModuleContext) android.ApiLevel {
minSdkVersion := mod.MinSdkVersion()
if minSdkVersion == "apex_inherit" {
- return nil
+ return android.MinApiLevel
}
+
if minSdkVersion == "" {
- return fmt.Errorf("min_sdk_version is not specificed")
+ return android.NoneApiLevel
}
-
// Not using nativeApiLevelFromUser because the context here is not
// necessarily a native context.
- ver, err := android.ApiLevelFromUser(ctx, minSdkVersion)
+ ver, err := android.ApiLevelFromUserWithConfig(ctx.Config(), minSdkVersion)
if err != nil {
- return err
+ return android.NoneApiLevel
}
- if ver.GreaterThan(sdkVersion) {
- return fmt.Errorf("newer SDK(%v)", ver)
- }
- return nil
+ return ver
}
// Implements android.ApexModule