Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE703F72E for ; Thu, 4 Apr 2013 15:52:37 +0000 (UTC) Received: (qmail 46389 invoked by uid 500); 4 Apr 2013 15:52:37 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 46186 invoked by uid 500); 4 Apr 2013 15:52:36 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 46157 invoked by uid 99); 4 Apr 2013 15:52:35 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 15:52:35 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5804583797B; Thu, 4 Apr 2013 15:52:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: maxw@apache.org To: commits@cordova.apache.org Message-Id: <486611a7495d407199c01aa7855dd782@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: js commit: [CB-2666] Added exec retries for null arguments. Date: Thu, 4 Apr 2013 15:52:33 +0000 (UTC) Updated Branches: refs/heads/master a429d52bd -> 10788b94d [CB-2666] Added exec retries for null arguments. When Java sends back a message saying that null arguments were received, we try to send them again with a different bridge mode. Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/10788b94 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/10788b94 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/10788b94 Branch: refs/heads/master Commit: 10788b94dbe91bd999d705ecab58f3a8fe7a9145 Parents: a429d52 Author: Max Woghiren Authored: Wed Mar 27 11:49:26 2013 -0400 Committer: Max Woghiren Committed: Thu Apr 4 11:51:23 2013 -0400 ---------------------------------------------------------------------- lib/android/exec.js | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/10788b94/lib/android/exec.js ---------------------------------------------------------------------- diff --git a/lib/android/exec.js b/lib/android/exec.js index af2715b..be58dff 100644 --- a/lib/android/exec.js +++ b/lib/android/exec.js @@ -95,7 +95,16 @@ function androidExec(success, fail, service, action, args) { window.location = 'http://cdv_exec/' + service + '#' + action + '#' + callbackId + '#' + argsJson; } else { var messages = nativeApiProvider.get().exec(service, action, callbackId, argsJson); - androidExec.processMessages(messages); + // If argsJson was received by Java as null, try again with the PROMPT bridge mode. + // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. + if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && messages === "@Null arguments.") { + androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); + androidExec(success, fail, service, action, args); + androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); + return; + } else { + androidExec.processMessages(messages); + } } if (cordova.callbacks[callbackId]) { if (success || fail) {