Support for adding dark greylist members from annotations.
Currently, we support maxTargetSdk values of 26 & 28, corresponding to
the P blacklist (existing dark grey list) and upcoming Q blacklist.
For now, just put the two into the same list, as the runtime support to
distinguish between the two does not exist yet.
Bug: 114361293
Test: m
Change-Id: I2f8d206e8dd22afc6c0e98fb5e53b1d78a534125
diff --git a/core/java.mk b/core/java.mk
index e5f1f4a..cf9bf56 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -76,6 +76,7 @@
java_source_list_file := $(intermediates.COMMON)/java-source-list
hiddenapi_whitelist_txt := $(intermediates.COMMON)/hiddenapi/whitelist.txt
hiddenapi_greylist_txt := $(intermediates.COMMON)/hiddenapi/greylist.txt
+hiddenapi_darkgreylist_txt := $(intermediates.COMMON)/hiddenapi/darkgreylist.txt
ifeq ($(LOCAL_MODULE_CLASS)$(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),APPS)
# If this is an apk without any Java code (e.g. framework-res), we should skip compiling Java.
@@ -503,8 +504,8 @@
# dex later on. The difference is academic currently, as we don't proguard any
# bootclasspath code at the moment. If we were to do that, we should add keep
# rules for all members with the @UnsupportedAppUsage annotation.
- $(eval $(call hiddenapi-generate-greylist-txt, $(full_classes_pre_proguard_jar),$(hiddenapi_whitelist_txt),$(hiddenapi_greylist_txt)))
- LOCAL_INTERMEDIATE_TARGETS += $(hiddenapi_whitelist_txt) $(hiddenapi_greylist_txt)
+ $(eval $(call hiddenapi-generate-greylist-txt, $(full_classes_pre_proguard_jar),$(hiddenapi_whitelist_txt),$(hiddenapi_greylist_txt),$(hiddenapi_darkgreylist_txt)))
+ LOCAL_INTERMEDIATE_TARGETS += $(hiddenapi_whitelist_txt) $(hiddenapi_greylist_txt) $(hiddenapi_darkgreylist_txt)
$(eval $(call hiddenapi-copy-dex-files,$(built_dex_intermediate),$(built_dex_hiddenapi)))
built_dex_copy_from := $(built_dex_hiddenapi)
else # !is_boot_jar