incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject js commit: [android] Set default bridge to ONLINE_EVENTS (take 2)
Date Fri, 21 Sep 2012 02:54:10 GMT
Updated Branches:
  refs/heads/master ea2d861c6 -> 2158f8809


[android] Set default bridge to ONLINE_EVENTS (take 2)

- CB-1498
- Also fixes broken unit test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/2158f880
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/2158f880
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/2158f880

Branch: refs/heads/master
Commit: 2158f8809bbbe5f434489ad07f8e87aadbd79687
Parents: ea2d861
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Sep 20 22:51:35 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Sep 20 22:51:35 2012 -0400

----------------------------------------------------------------------
 lib/android/exec.js |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2158f880/lib/android/exec.js
----------------------------------------------------------------------
diff --git a/lib/android/exec.js b/lib/android/exec.js
index 2f68e54..9b36359 100644
--- a/lib/android/exec.js
+++ b/lib/android/exec.js
@@ -37,8 +37,6 @@ var cordova = require('cordova'),
     callback = require('cordova/plugin/android/callback'),
     polling = require('cordova/plugin/android/polling'),
     nativeApiProvider = require('cordova/plugin/android/nativeapiprovider'),
-    jsToNativeBridgeMode,
-    nativeToJsBridgeMode,
     jsToNativeModes = {
         PROMPT: 0,
         JS_OBJECT: 1,
@@ -64,14 +62,15 @@ var cordova = require('cordova'),
         // to be executed.
         // Requires Android 3.2.4 or above.
         PRIVATE_API: 4
-    };
+    },
+    jsToNativeBridgeMode,  // Set lazily.
+    nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
 
 function androidExec(success, fail, service, action, args) {
     // Set default bridge modes if they have not already been set.
     if (jsToNativeBridgeMode === undefined) {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
+        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
     }
-    androidExec.setNativeToJsBridgeMode(nativeToJsModes.ONLINE_EVENT);
 
     var callbackId = service + cordova.callbackId++,
         argsJson = JSON.stringify(args);


Mime
View raw message