From 98e9ac6075d23ac9e06e87bf881bebccbef4505c Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Wed, 25 Sep 2024 23:42:30 +0000 Subject: Remove the SdkLibraryDependency interface Instead, provide the information of the source/prebuilt java_sdk_library to the rdeps via the SdkLibraryInfoProvider. Test: m nothing --no-skip-soong-tests && diff ninja file Bug: 348040422 Change-Id: If6cd3cd260a8ce8dccead7f302840cabf68a9fae --- java/hiddenapi_modular.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'java/hiddenapi_modular.go') diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index 4144de82b..365005835 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -298,13 +298,12 @@ func hiddenAPIAddStubLibDependencies(ctx android.BottomUpMutatorContext, apiScop // available, or reports an error. func hiddenAPIRetrieveDexJarBuildPath(ctx android.ModuleContext, module android.Module, kind android.SdkKind) android.Path { var dexJar OptionalDexJarPath - if sdkLibrary, ok := module.(SdkLibraryDependency); ok { + if sdkLibrary, ok := android.OtherModuleProvider(ctx, module, SdkLibraryInfoProvider); ok { if ctx.Config().ReleaseHiddenApiExportableStubs() { - dexJar = sdkLibrary.SdkApiExportableStubDexJar(ctx, kind) + dexJar = sdkLibrary.ExportableStubDexJarPaths[kind] } else { - dexJar = sdkLibrary.SdkApiStubDexJar(ctx, kind) + dexJar = sdkLibrary.EverythingStubDexJarPaths[kind] } - } else if j, ok := module.(UsesLibraryDependency); ok { dexJar = j.DexJarBuildPath(ctx) } else { @@ -853,15 +852,15 @@ func (i *HiddenAPIFlagInput) gatherStubLibInfo(ctx android.ModuleContext, conten i.StubDexJarsByScope.addStubDexJar(ctx, module, apiScope, dexJar) } - if sdkLibrary, ok := module.(SdkLibraryDependency); ok { - removedTxtFile := sdkLibrary.SdkRemovedTxtFile(ctx, sdkKind) + if sdkLibrary, ok := android.OtherModuleProvider(ctx, module, SdkLibraryInfoProvider); ok { + removedTxtFile := sdkLibrary.RemovedTxtFiles[sdkKind] i.RemovedTxtFiles = append(i.RemovedTxtFiles, removedTxtFile.AsPaths()...) } } // If the contents includes any java_sdk_library modules then add them to the stubs. for _, module := range contents { - if _, ok := module.(SdkLibraryDependency); ok { + if _, ok := android.OtherModuleProvider(ctx, module, SdkLibraryInfoProvider); ok { // Add information for every possible API scope needed by hidden API. for _, apiScope := range hiddenAPISdkLibrarySupportedScopes { addFromModule(ctx, module, apiScope) -- cgit v1.2.3-59-g8ed1b