summaryrefslogtreecommitdiff
path: root/runtime/native/dalvik_system_VMRuntime.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2018-11-16 14:21:47 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-11-16 14:21:47 +0000
commit54c7da9c50ee85ade636605cd6ea18b4c2bc69fa (patch)
tree57e1a23dcc0beba8e98841b8cf063f6153b08c9b /runtime/native/dalvik_system_VMRuntime.cc
parentd94653399e2f9f06bbdf629f2affbf9a4fa73b8f (diff)
parent2bb2fbd2879d0a6d9ebf7acff817079dde89b417 (diff)
Merge changes Idc6e518c,Ia1cc0506
* changes: Create SdkVersion enum, migrate users to it Runtime flags only for fast/slow hiddenapi path
Diffstat (limited to 'runtime/native/dalvik_system_VMRuntime.cc')
-rw-r--r--runtime/native/dalvik_system_VMRuntime.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index 49b71cd801..e213dc79b8 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -29,6 +29,7 @@ extern "C" void android_set_application_target_sdk_version(uint32_t version);
#include "arch/instruction_set.h"
#include "art_method-inl.h"
#include "base/enums.h"
+#include "base/sdk_version.h"
#include "class_linker-inl.h"
#include "common_throws.h"
#include "debugger.h"
@@ -256,12 +257,15 @@ static void VMRuntime_setTargetSdkVersionNative(JNIEnv*, jobject, jint target_sd
// where workarounds can be enabled.
// Note that targetSdkVersion may be CUR_DEVELOPMENT (10000).
// Note that targetSdkVersion may be 0, meaning "current".
- Runtime::Current()->SetTargetSdkVersion(target_sdk_version);
+ uint32_t uint_target_sdk_version =
+ target_sdk_version <= 0 ? static_cast<uint32_t>(SdkVersion::kUnset)
+ : static_cast<uint32_t>(target_sdk_version);
+ Runtime::Current()->SetTargetSdkVersion(uint_target_sdk_version);
#ifdef ART_TARGET_ANDROID
// This part is letting libc/dynamic linker know about current app's
// target sdk version to enable compatibility workarounds.
- android_set_application_target_sdk_version(static_cast<uint32_t>(target_sdk_version));
+ android_set_application_target_sdk_version(uint_target_sdk_version);
#endif
}