summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-02-04 17:49:33 +0000
committer Paul Duffin <paulduffin@google.com> 2021-02-07 10:58:24 +0000
commit01289a24076289369e8eb6995d35d276f225d18e (patch)
tree68604918dbd4538c153f3233604197cb0370b817 /java/hiddenapi_singleton.go
parent89886cbdb05cf4a4445a4fc7706ccff91fb310fd (diff)
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
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 32d1e3faa..46994c396 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -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 {