summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
author Eric Jeong <ericjeong@google.com> 2020-06-04 17:56:18 -0700
committer Eric Jeong <ericjeong@google.com> 2020-06-05 09:07:27 -0700
commit9791efa3e8e88836201e16f1e57401a0c215d0de (patch)
tree562dc29805bb8d19047e5a875d22f0cfe0684e10 /java/hiddenapi_singleton.go
parentd7fdfd6e772a4bf79966ca0ebc4bd2fee4b63cc6 (diff)
Include car project in grey list removed apis
- Car framework has removed system APIs. - These APIs should be tracked at run-time. Bug: 154832144 Test: 1) android.signature.cts.api.AnnotationTest#testAnnotation 2) diff $OUT/soong/hiddenapi/hiddenapi-flags.csv before and after this CL Change-Id: I9813df4b514da41e82d45e6c0bc92643916fe0d8
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index c7f7cbdfe..95dd0bb09 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -207,6 +207,15 @@ func stubFlagsRule(ctx android.SingletonContext) {
rule.Build(pctx, ctx, "hiddenAPIStubFlagsFile", "hiddenapi stub flags")
}
+func moduleForGreyListRemovedApis(ctx android.SingletonContext, module android.Module) bool {
+ switch ctx.ModuleName(module) {
+ case "api-stubs-docs", "system-api-stubs-docs", "android.car-stubs-docs", "android.car-system-stubs-docs":
+ return true
+ default:
+ return false
+ }
+}
+
// flagsRule creates a rule to build hiddenapi-flags.csv out of flags.csv files generated for boot image modules and
// the greylists.
func flagsRule(ctx android.SingletonContext) android.Path {
@@ -222,7 +231,7 @@ func flagsRule(ctx android.SingletonContext) android.Path {
// Track @removed public and system APIs via corresponding droidstubs targets.
// These APIs are not present in the stubs, however, we have to keep allowing access
// to them at runtime.
- if m := ctx.ModuleName(module); m == "api-stubs-docs" || m == "system-api-stubs-docs" {
+ if moduleForGreyListRemovedApis(ctx, module) {
greylistRemovedApis = append(greylistRemovedApis, ds.removedDexApiFile)
}
}