summaryrefslogtreecommitdiff
path: root/runtime/jni/java_vm_ext.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/jni/java_vm_ext.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/jni/java_vm_ext.cc')
-rw-r--r--runtime/jni/java_vm_ext.cc3
1 files changed, 2 insertions, 1 deletions
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<JNI_OnLoadFn>(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);
}