summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/entrypoint_utils.cc
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2014-05-29 17:29:47 -0700
committer Jeff Hao <jeffhao@google.com> 2014-06-02 09:59:22 -0700
commitf00571c4e1ae202b3b4acb6b47cbe23a65178f7f (patch)
tree484d129a8265d03eff56c796e92e302e23ad5e16 /runtime/entrypoints/entrypoint_utils.cc
parentf6b5378ba182c5c26c556ae34638afc38adef519 (diff)
Added workaround passing empty arg array for proxy invocation.
This recreates old Dalvik behavior for older target sdk versions, but will still pass null for newer ones. Bug: 13247236 (cherry picked from commit 01d5a146e20660bd06f026c16f19ec080f8fdd7b) Change-Id: I911889cf559ad8d9f37ea9be3929387c86446851
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.cc')
-rw-r--r--runtime/entrypoints/entrypoint_utils.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index 39b2ec2dae..320273d176 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -148,7 +148,9 @@ JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, cons
soa.Self()->AssertThreadSuspensionIsAllowable();
jobjectArray args_jobj = NULL;
const JValue zero;
- if (args.size() > 0) {
+ int32_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)) {
args_jobj = soa.Env()->NewObjectArray(args.size(), WellKnownClasses::java_lang_Object, NULL);
if (args_jobj == NULL) {
CHECK(soa.Self()->IsExceptionPending());