Tweak logic for when extension txt is latest
Always use the latest extension as the latest API, regardless of the current base extension version. This makes it so that we can bump the base in master without changing which txt is considered latest. Also extend the error check to apply more widely (which caught an error in the extension 3 finalization). Bug: 228017107 Test: m checkapi (with api break & bumped base) Test: prebuilt_apis_test.go Change-Id: Ia10eb41ff500c566736f0d29a29984a99386bb6f
This commit is contained in:
@@ -255,12 +255,11 @@ func prebuiltApiFiles(mctx android.LoadHookContext, p *prebuiltApis) {
|
||||
if p.properties.Extensions_dir != nil {
|
||||
extensionApiFiles := globExtensionDirs(mctx, p, "api/*.txt")
|
||||
for k, v := range getLatest(extensionApiFiles) {
|
||||
if v.version > mctx.Config().PlatformBaseSdkExtensionVersion() {
|
||||
if _, exists := latest[k]; !exists {
|
||||
mctx.ModuleErrorf("Module %v finalized for extension %d but never during an API level; likely error", v.module, v.version)
|
||||
}
|
||||
latest[k] = v
|
||||
if _, exists := latest[k]; !exists {
|
||||
mctx.ModuleErrorf("Module %v finalized for extension %d but never during an API level; likely error", v.module, v.version)
|
||||
}
|
||||
// The extension version is always at least as new as the last sdk int version (potentially identical)
|
||||
latest[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user