Rename and reorganize hiddenapi::ApiList

Change values of ApiList flags to make them easier to extend in the
future and unify naming across all components. Light greylist is now
just "Greylist", dark greylist becomes "GreylistMaxO".

Note that the version code in "GreylistMaxO" must also include any
maintenance releases, i.e. entries on "GreylistMaxO" are accessible
to apps with targetSdkVersion<=27 (O MR1).

Test: m, phone boots
Test: m test-art
Change-Id: I9622e0646eb265008a8bb2652270876ae95dac84
diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h
index 32bae11..eea58e9 100644
--- a/runtime/hidden_api.h
+++ b/runtime/hidden_api.h
@@ -19,8 +19,8 @@
 
 #include "art_field.h"
 #include "art_method.h"
+#include "base/hiddenapi_flags.h"
 #include "base/mutex.h"
-#include "dex/hidden_api_access_flags.h"
 #include "intrinsics_enum.h"
 #include "mirror/class-inl.h"
 #include "reflection.h"
@@ -177,10 +177,10 @@
   uint32_t runtime_flags = 0u;
 
   uint32_t dex_flags = member.GetHiddenapiFlags();
-  DCHECK(AreValidFlags(dex_flags));
+  DCHECK(AreValidDexFlags(dex_flags));
 
-  ApiList api_list = static_cast<hiddenapi::ApiList>(dex_flags);
-  if (api_list == ApiList::kWhitelist) {
+  ApiList api_list = ApiList::FromDexFlags(dex_flags);
+  if (api_list == ApiList::Whitelist()) {
     runtime_flags |= kAccPublicApi;
   }
 
@@ -316,7 +316,7 @@
   // Decode hidden API access flags from the dex file.
   // This is an O(N) operation scaling with the number of fields/methods
   // in the class. Only do this on slow path and only do it once.
-  ApiList api_list = static_cast<hiddenapi::ApiList>(detail::GetDexFlags(member));
+  ApiList api_list = ApiList::FromDexFlags(detail::GetDexFlags(member));
 
   // Member is hidden and caller is not exempted. Enter slow path.
   return detail::ShouldDenyAccessToMemberImpl(member, api_list, access_method);