diff options
author | 2024-09-25 23:42:30 +0000 | |
---|---|---|
committer | 2024-09-26 17:49:18 +0000 | |
commit | 98e9ac6075d23ac9e06e87bf881bebccbef4505c (patch) | |
tree | 56d552843c626db25d4bd75e4f2cb28cfd0cc579 /java/hiddenapi_modular.go | |
parent | 1c4625a5ec6f6726ca44962947e6e353077c05de (diff) |
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
Diffstat (limited to 'java/hiddenapi_modular.go')
-rw-r--r-- | java/hiddenapi_modular.go | 13 |
1 files changed, 6 insertions, 7 deletions
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) |