From 2bb2fbd2879d0a6d9ebf7acff817079dde89b417 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 13 Nov 2018 18:24:26 +0000 Subject: 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 --- runtime/jni/java_vm_ext.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/jni/java_vm_ext.cc') diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc index 6769368ee4..a61a48a29b 100644 --- a/runtime/jni/java_vm_ext.cc +++ b/runtime/jni/java_vm_ext.cc @@ -23,6 +23,7 @@ #include "art_method-inl.h" #include "base/dumpable.h" #include "base/mutex-inl.h" +#include "base/sdk_version.h" #include "base/stl_util.h" #include "base/systrace.h" #include "check_jni.h" @@ -1030,7 +1031,7 @@ bool JavaVMExt::LoadNativeLibrary(JNIEnv* env, JNI_OnLoadFn jni_on_load = reinterpret_cast(sym); int version = (*jni_on_load)(this, nullptr); - if (runtime_->GetTargetSdkVersion() != 0 && runtime_->GetTargetSdkVersion() <= 21) { + if (IsSdkVersionSetAndAtMost(runtime_->GetTargetSdkVersion(), SdkVersion::kL)) { // Make sure that sigchain owns SIGSEGV. EnsureFrontOfChain(SIGSEGV); } -- cgit v1.2.3-59-g8ed1b