From 7212dbef03157f0bd048410c07283e4f1232b876 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 20 Sep 2022 17:08:49 +0000 Subject: 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 --- java/prebuilt_apis.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'java/prebuilt_apis.go') diff --git a/java/prebuilt_apis.go b/java/prebuilt_apis.go index 944970783..c6acd55e5 100644 --- a/java/prebuilt_apis.go +++ b/java/prebuilt_apis.go @@ -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 } } -- cgit v1.2.3-59-g8ed1b