Make blacklist the default hidden API list

Starting with DP1 we will move private APIs that have not been
explicitly greylisted into the blacklist. Modify Android.mk to
generate the API lists accordingly.

Bug: 64382372
Test: make, inspect out/target/common/obj/PACKAGING/hiddenapi-*
Change-Id: I1d817ba6b95058ad052a2c7663ef99257bdeffc1
This commit is contained in:
David Brazdil
2018-02-07 00:39:22 +00:00
parent c99f5a72fd
commit 3f4136c3b7
2 changed files with 16 additions and 16 deletions

View File

@@ -827,35 +827,35 @@ include $(BUILD_STATIC_JAVA_LIBRARY)
# ==== hiddenapi lists =======================================
# Copy blacklist and light greylist over into the build folder.
# Copy light greylist and dark greylist over into the build folder.
# This is for ART buildbots which need to mock these lists and have alternative
# rules for building them. Other rules in the build system should depend on the
# files in the build folder.
$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-blacklist.txt,\
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)))
$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-light-greylist.txt,\
$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)))
$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)))
# Generate dark greylist as private API minus (blacklist plus light greylist).
# Generate blacklist as private API minus (light greylist plus dark greylist).
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) \
$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
if [ ! -z "`comm -12 <(sort $(BLACKLIST)) <(sort $(LIGHT_GREYLIST))`" ]; then \
echo "There should be no overlap between $(BLACKLIST) and $(LIGHT_GREYLIST)" 1>&2; \
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \
echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \
exit 1; \
elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST))`" ]; then \
echo "$(BLACKLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
exit 2; \
elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \
echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
exit 2; \
elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \
echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
exit 3; \
fi
comm -23 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST) $(LIGHT_GREYLIST)) > $@
comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@
# Include subdirectory makefiles
# ============================================================