Convert more versions in config to ApiLevel.
The test case I removed is invalid. The codename has had its int assigned, but the config claims it is not final. If this ever does need to be supported it's just a matter of making sure the Q -> 29 mapping (or whatever) in the finalized codenames map in android/api_levels.go. Test: treehugger Bug: http://b/154667674 Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
This commit is contained in:
@@ -247,7 +247,7 @@ func (s sdkSpec) effectiveVersion(ctx android.EarlyModuleContext) (sdkVersion, e
|
||||
if s.version.isNumbered() {
|
||||
return s.version, nil
|
||||
}
|
||||
return sdkVersion(ctx.Config().DefaultAppTargetSdkInt()), nil
|
||||
return sdkVersion(ctx.Config().DefaultAppTargetSdk(ctx).FinalOrFutureInt()), nil
|
||||
}
|
||||
|
||||
// effectiveVersionString converts an sdkSpec into the concrete version string that the module
|
||||
@@ -255,8 +255,8 @@ func (s sdkSpec) effectiveVersion(ctx android.EarlyModuleContext) (sdkVersion, e
|
||||
// it returns the codename (P, Q, R, etc.)
|
||||
func (s sdkSpec) effectiveVersionString(ctx android.EarlyModuleContext) (string, error) {
|
||||
ver, err := s.effectiveVersion(ctx)
|
||||
if err == nil && int(ver) == ctx.Config().DefaultAppTargetSdkInt() {
|
||||
return ctx.Config().DefaultAppTargetSdk(), nil
|
||||
if err == nil && int(ver) == ctx.Config().DefaultAppTargetSdk(ctx).FinalOrFutureInt() {
|
||||
return ctx.Config().DefaultAppTargetSdk(ctx).String(), nil
|
||||
}
|
||||
return ver.String(), err
|
||||
}
|
||||
|
Reference in New Issue
Block a user