Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 877f39d5 authored by Spandan Das's avatar Spandan Das
Browse files

Use stubs from .txt files for hiddenapi

Hiddenapi processing uses the stub libraries to determine the api
surface boundaries. Use JavaLibraryName function to redirect the usage
of stubs from .txt files based on config.

This should be a no-op for now.

Bug: 271443071
Test: go test ./java
Change-Id: I1ed3ab2485c903bc57f627dc1acf1a3fbc0a3c4d
parent 69f4218c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -499,6 +499,8 @@ func (b *BootclasspathFragmentModule) DepsMutator(ctx android.BottomUpMutatorCon
		for _, apiScope := range hiddenAPISdkLibrarySupportedScopes {
			// Add a dependency onto a possibly scope specific stub library.
			scopeSpecificDependency := apiScope.scopeSpecificStubModule(ctx, additionalStubModule)
			// Use JavaApiLibraryName function to be redirected to stubs generated from .txt if applicable
			scopeSpecificDependency = android.JavaApiLibraryName(ctx.Config(), scopeSpecificDependency)
			tag := hiddenAPIStubsDependencyTag{apiScope: apiScope, fromAdditionalDependency: true}
			ctx.AddVariationDependencies(nil, tag, scopeSpecificDependency)
		}
+4 −1
Original line number Diff line number Diff line
@@ -1267,7 +1267,10 @@ var implLibraryTag = sdkLibraryComponentTag{name: "impl-library"}
func (module *SdkLibrary) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
	for _, apiScope := range module.getGeneratedApiScopes(ctx) {
		// Add dependencies to the stubs library
		ctx.AddVariationDependencies(nil, apiScope.stubsTag, module.stubsLibraryModuleName(apiScope))
		stubModuleName := module.stubsLibraryModuleName(apiScope)
		// Use JavaApiLibraryName function to be redirected to stubs generated from .txt if applicable
		stubModuleName = android.JavaApiLibraryName(ctx.Config(), stubModuleName)
		ctx.AddVariationDependencies(nil, apiScope.stubsTag, stubModuleName)

		// Add a dependency on the stubs source in order to access both stubs source and api information.
		ctx.AddVariationDependencies(nil, apiScope.stubsSourceAndApiTag, module.stubsSourceModuleName(apiScope))