summaryrefslogtreecommitdiff
path: root/runtime/hidden_api_test.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2018-11-13 18:24:26 +0000
committer David Brazdil <dbrazdil@google.com> 2018-11-16 11:11:20 +0000
commit2bb2fbd2879d0a6d9ebf7acff817079dde89b417 (patch)
treed607aa6bfb2ea55fbfd875237b37c79f3cfed5f6 /runtime/hidden_api_test.cc
parent85865697ff9fabede3d64ff64cde72727c3fc4c1 (diff)
Create SdkVersion enum, migrate users to it
Creates a new SdkVersion enum with integer codes of known Android SDK versions, together with helper functions for common predicates. Also converts target_sdk_version_ in Runtime to uint32_t and cleans up its uses. Test: m test-art Change-Id: Idc6e518c8675068bf952d0256686c88bb0eb833e
Diffstat (limited to 'runtime/hidden_api_test.cc')
-rw-r--r--runtime/hidden_api_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index 627d9a7e1c..314d878c66 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -16,6 +16,7 @@
#include "hidden_api.h"
+#include "base/sdk_version.h"
#include "common_runtime_test.h"
#include "jni/jni_internal.h"
#include "proxy_test.h"
@@ -112,14 +113,14 @@ TEST_F(HiddenApiTest, CheckGetActionFromRuntimeFlags) {
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kBlacklist), false);
runtime_->SetHiddenApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kEnabled);
- runtime_->SetTargetSdkVersion(static_cast<int32_t>(hiddenapi::detail::SdkCodes::kVersionO_MR1));
+ runtime_->SetTargetSdkVersion(static_cast<uint32_t>(SdkVersion::kO_MR1));
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kWhitelist), false);
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kLightGreylist), false);
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kDarkGreylist), false);
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kBlacklist), true);
runtime_->SetHiddenApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kEnabled);
- runtime_->SetTargetSdkVersion(static_cast<int32_t>(hiddenapi::detail::SdkCodes::kVersionP));
+ runtime_->SetTargetSdkVersion(static_cast<uint32_t>(SdkVersion::kP));
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kWhitelist), false);
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kLightGreylist), false);
ASSERT_EQ(ShouldDenyAccess(hiddenapi::ApiList::kDarkGreylist), true);