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/definitions.mk b/core/definitions.mk
index ffd8602..d9cfa62 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2870,16 +2870,20 @@
 define hiddenapi-generate-greylist-txt
 ifneq (,$(wildcard frameworks/base))
 # Only generate this target if we're in a tree with frameworks/base present.
-$(3): .KATI_IMPLICIT_OUTPUTS := $(2)
+$(3): .KATI_IMPLICIT_OUTPUTS := $(2) $(4)
+# For now, write P & Q blacklist to single file until runtime support is finished
 $(3): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)
 	$(CLASS2GREYLIST) --public-api-list $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) $(1) \
-	    --write-whitelist $(2) --write-greylist $(3)
+	    --write-whitelist $(2) \
+	    --write-greylist $(3) \
+	    --write-greylist 26,28:$(4)
 
-$(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): $(2) $(3)
+$(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): $(2) $(3) $(4)
 $(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): \
     PRIVATE_WHITELIST_INPUTS := $$(PRIVATE_WHITELIST_INPUTS) $(2)
 $(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): \
     PRIVATE_GREYLIST_INPUTS := $$(PRIVATE_GREYLIST_INPUTS) $(3)
+    PRIVATE_DARKGREYLIST_INPUTS := $$(PRIVATE_DARKGREYLIST_INPUTS) $(4)
 endif
 endef