Provide min sdk version as ApiLevel instead of string.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I8c7b3b493877a9857ca433b015e6e49ad8387f91
diff --git a/apex/builder.go b/apex/builder.go
index 03a0bb9..8427719 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1132,10 +1132,9 @@
depInfos[to.Name()] = info
} else {
toMinSdkVersion := "(no version)"
- if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok {
- if v := info.MinSdkVersion; v != "" {
- toMinSdkVersion = v
- }
+ if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok &&
+ !info.MinSdkVersion.IsPlatform && info.MinSdkVersion.ApiLevel != nil {
+ toMinSdkVersion = info.MinSdkVersion.ApiLevel.String()
}
depInfos[to.Name()] = android.ApexModuleDepInfo{
To: to.Name(),