diff options
author | 2018-11-13 18:24:26 +0000 | |
---|---|---|
committer | 2018-11-16 11:11:20 +0000 | |
commit | 2bb2fbd2879d0a6d9ebf7acff817079dde89b417 (patch) | |
tree | d607aa6bfb2ea55fbfd875237b37c79f3cfed5f6 /runtime/entrypoints/entrypoint_utils.cc | |
parent | 85865697ff9fabede3d64ff64cde72727c3fc4c1 (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/entrypoints/entrypoint_utils.cc')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc index 12136bf476..19498f386c 100644 --- a/runtime/entrypoints/entrypoint_utils.cc +++ b/runtime/entrypoints/entrypoint_utils.cc @@ -20,6 +20,7 @@ #include "art_method-inl.h" #include "base/enums.h" #include "base/mutex.h" +#include "base/sdk_version.h" #include "class_linker-inl.h" #include "dex/dex_file-inl.h" #include "entrypoints/entrypoint_utils-inl.h" @@ -64,9 +65,9 @@ JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, cons soa.Self()->AssertThreadSuspensionIsAllowable(); jobjectArray args_jobj = nullptr; const JValue zero; - int32_t target_sdk_version = Runtime::Current()->GetTargetSdkVersion(); + uint32_t target_sdk_version = Runtime::Current()->GetTargetSdkVersion(); // Do not create empty arrays unless needed to maintain Dalvik bug compatibility. - if (args.size() > 0 || (target_sdk_version > 0 && target_sdk_version <= 21)) { + if (args.size() > 0 || IsSdkVersionSetAndAtMost(target_sdk_version, SdkVersion::kL)) { args_jobj = soa.Env()->NewObjectArray(args.size(), WellKnownClasses::java_lang_Object, nullptr); if (args_jobj == nullptr) { CHECK(soa.Self()->IsExceptionPending()); |