Refactor build rules for hidden API lists

The build rules were getting messy and too difficult to extend.
Extract assertions into own functions, create shared variables.

Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Merged-In: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
Change-Id: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
(cherry picked from commit 721bc8e6a8b1350c62b4a570f523541d1ce1124a)
2 files changed