From fa5e6b50aa739692da015981686e604ea94f579c Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 13 Apr 2021 19:09:48 +0100 Subject: [PATCH] Remove special case code for obsolete files incompatibilities.txt doesn't exist anymore, only "-incompatibilities.txt". Clean up the associated logic that mapped incompatibilities.txt to android-incompatibilities.txt. Bug: 178171189 Test: m Change-Id: I61eeb5dcc82770fa2af356bad11b7205551d6d83 --- java/prebuilt_apis.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/java/prebuilt_apis.go b/java/prebuilt_apis.go index 8a442b5ff..c33e6c229 100644 --- a/java/prebuilt_apis.go +++ b/java/prebuilt_apis.go @@ -253,14 +253,8 @@ func prebuiltApiFiles(mctx android.LoadHookContext, p *prebuiltApis) { files := getPrebuiltFilesInSubdir(mctx, nextApiDir, "api/*incompatibilities.txt") for _, f := range files { localPath := strings.TrimPrefix(f, mydir) - module, _, scope := parseApiFilePath(mctx, localPath) - - // Figure out which module is referenced by this file. Special case for "android". - referencedModule := strings.TrimSuffix(module, "incompatibilities") - referencedModule = strings.TrimSuffix(referencedModule, "-") - if referencedModule == "" { - referencedModule = "android" - } + filename, _, scope := parseApiFilePath(mctx, localPath) + referencedModule := strings.TrimSuffix(filename, "-incompatibilities") createApiModule(mctx, apiModuleName(referencedModule+"-incompatibilities", scope, "latest"), localPath)