Support hidden API whitelist generated by class2greylist

Libcore has support for annotating a virtual method which is known
to change its return type in a future release. This annotation is
recognized by the dexer and a future-proof bridge method is created.
This patch integrates changes in class2greylist to support this
annotation into the build system and generation of hidden API lists.

Calling class2greylist on each boot classpath module now produces two
text files instead of one: signatures for greylisting and now also
whitelisting. They are passed on to the hidden API list generating rules
in frameworks/base.

Bug: 112186571
Test: m appcompat, diff public-list.txt whitelist.txt
Change-Id: I9861203e6e07a17d50850892ec13880971457d11
diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk
index 92b97bd..311e3d4 100644
--- a/core/soong_java_prebuilt.mk
+++ b/core/soong_java_prebuilt.mk
@@ -19,7 +19,8 @@
 full_classes_pre_proguard_jar := $(intermediates.COMMON)/classes-pre-proguard.jar
 full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar
 common_javalib.jar := $(intermediates.COMMON)/javalib.jar
-greylist_txt := $(intermediates.COMMON)/greylist.txt
+hiddenapi_whitelist_txt := $(intermediates.COMMON)/hiddenapi/whitelist.txt
+hiddenapi_greylist_txt := $(intermediates.COMMON)/hiddenapi/greylist.txt
 
 $(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(full_classes_jar)))
 $(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(full_classes_pre_proguard_jar)))
@@ -77,7 +78,7 @@
         # We use full_classes_jar here, which is the post-proguard jar (on the basis that we also
         # have a full_classes_pre_proguard_jar). This is consistent with the equivalent code in
         # java.mk.
-        $(eval $(call hiddenapi-generate-greylist-txt,$(full_classes_jar),$(greylist_txt)))
+        $(eval $(call hiddenapi-generate-greylist-txt,$(full_classes_jar),$(hiddenapi_whitelist_txt),$(hiddenapi_greylist_txt)))
         $(eval $(call hiddenapi-copy-soong-jar,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
       else # !is_boot_jar
         $(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))