You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2016/09/09 19:05:26 UTC
[2/2] android commit: CB-11828: Switching default bridge back to
ONLINE_BRIDGE
CB-11828: Switching default bridge back to ONLINE_BRIDGE
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/deea0f7e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/deea0f7e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/deea0f7e
Branch: refs/heads/master
Commit: deea0f7e4f0d7baeabab14e0b057d24b97bbf893
Parents: 3a33f4c
Author: Joe Bowser <bo...@apache.org>
Authored: Thu Sep 8 15:29:00 2016 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri Sep 9 12:05:19 2016 -0700
----------------------------------------------------------------------
bin/templates/project/assets/www/cordova.js | 2 +-
cordova-js-src/exec.js | 2 +-
.../org/apache/cordova/engine/SystemWebViewEngine.java | 11 +++++++++--
3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/deea0f7e/bin/templates/project/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/assets/www/cordova.js b/bin/templates/project/assets/www/cordova.js
index a7a9c0a..700c667 100644
--- a/bin/templates/project/assets/www/cordova.js
+++ b/bin/templates/project/assets/www/cordova.js
@@ -901,7 +901,7 @@ var cordova = require('cordova'),
EVAL_BRIDGE: 3
},
jsToNativeBridgeMode, // Set lazily.
- nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
+ nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
pollEnabled = false,
bridgeSecret = -1;
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/deea0f7e/cordova-js-src/exec.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js
index eab81c0..197fb5d 100644
--- a/cordova-js-src/exec.js
+++ b/cordova-js-src/exec.js
@@ -55,7 +55,7 @@ var cordova = require('cordova'),
EVAL_BRIDGE: 3
},
jsToNativeBridgeMode, // Set lazily.
- nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
+ nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
pollEnabled = false,
bridgeSecret = -1;
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/deea0f7e/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
index c0ea94a..84cb05a 100755
--- a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
+++ b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
@@ -117,7 +117,8 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
SystemWebViewEngine.this.cordova.getActivity().runOnUiThread(r);
}
}));
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
+ if(Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2)
+ nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue);
exposeJsInterface(webView, bridge);
}
@@ -336,6 +337,12 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
@Override
public void evaluateJavascript(String js, ValueCallback<String> callback) {
- webView.evaluateJavascript(js, callback);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ webView.evaluateJavascript(js, callback);
+ }
+ else
+ {
+ LOG.d(TAG, "This webview is using the old bridge");
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org