Add test for hiddenAPI index file generation

The index file and the metadata file both currently include duplicate
entries due to them including both the <x> and <x>.impl libraries
created by java_sdk_library in their inputs, plus including both source
and prebuilt versions of the same named module. This change adds a test
to illustrate that behavior. A follow up change will correct the problem
and update the test accordingly.

This change only adds a test for the index file because the metadata
file depends on files from frameworks/base which makes it difficult to
test. Bug 177317659 will fix that and allow the metadata file
generation to be tested too.

Bug: 178361284
Test: m nothing
Change-Id: I33921d7267c9f4bb42726343d73f8a396d536aaa
This commit is contained in:
Paul Duffin
2021-02-04 17:49:33 +00:00
parent 89886cbdb0
commit 01289a2407
2 changed files with 56 additions and 10 deletions

View File

@@ -22,9 +22,13 @@ import (
)
func init() {
android.RegisterSingletonType("hiddenapi", hiddenAPISingletonFactory)
android.RegisterSingletonType("hiddenapi_index", hiddenAPIIndexSingletonFactory)
android.RegisterModuleType("hiddenapi_flags", hiddenAPIFlagsFactory)
RegisterHiddenApiSingletonComponents(android.InitRegistrationContext)
}
func RegisterHiddenApiSingletonComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("hiddenapi", hiddenAPISingletonFactory)
ctx.RegisterSingletonType("hiddenapi_index", hiddenAPIIndexSingletonFactory)
ctx.RegisterModuleType("hiddenapi_flags", hiddenAPIFlagsFactory)
}
type hiddenAPISingletonPathsStruct struct {