From 50dea427292b6e5435c6cd0010e2f3f05b3900e4 Mon Sep 17 00:00:00 2001 From: Mathew Inwood Date: Fri, 5 Oct 2018 15:47:29 +0100 Subject: [PATCH] Add new "max-sdk-p blacklist". This will contain greylist entries accessible by apps with a targetSdkVersion of less than Q. Currently empty, will be populated in follow up CLs. For now, these APIs are just merged into the light greylist at build time, pending support in the runtime for implementing the correct runtime behavior. Also fix a bug in sort_api.sh so it deals with empty API lists correctly. Bug: 115609023 Test: m Change-Id: I213874062f393f96d120648a934ae5ad7aba93af --- Android.mk | 2 ++ config/hiddenapi-max-sdk-p-blacklist.txt | 0 tools/hiddenapi/sort_api.sh | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 config/hiddenapi-max-sdk-p-blacklist.txt diff --git a/Android.mk b/Android.mk index d33307425968e..ba153ee76b0ae 100644 --- a/Android.mk +++ b/Android.mk @@ -87,6 +87,7 @@ $(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): \ frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py \ frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ + frameworks/base/config/hiddenapi-max-sdk-p-blacklist.txt \ frameworks/base/config/hiddenapi-force-blacklist.txt \ $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \ $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \ @@ -98,6 +99,7 @@ $(INTERNAL_PLATFORM_HIDDENAPI_WHITELIST): \ --input-greylists \ frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ + frameworks/base/config/hiddenapi-max-sdk-p-blacklist.txt \ <(comm -12 <(sort $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)) \ $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST)) \ $(PRIVATE_GREYLIST_INPUTS) \ diff --git a/config/hiddenapi-max-sdk-p-blacklist.txt b/config/hiddenapi-max-sdk-p-blacklist.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tools/hiddenapi/sort_api.sh b/tools/hiddenapi/sort_api.sh index 76a2f2d6eba10..7cdcf18bb3fc5 100755 --- a/tools/hiddenapi/sort_api.sh +++ b/tools/hiddenapi/sort_api.sh @@ -21,4 +21,6 @@ A=( $(uniq <<< "${A[*]}") ) A=( ${C[*]} ${A[*]} ) unset IFS # Dump array back into the file -printf '%s\n' "${A[@]}" > "$dest_list" +if [ ${#A[@]} -neq 0 ]; then + printf '%s\n' "${A[@]}" > "$dest_list" +fi