mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
CB-11828: Switching default bridge back to ONLINE_BRIDGE
This commit is contained in:
parent
3a33f4c0a6
commit
deea0f7e4f
2
bin/templates/project/assets/www/cordova.js
vendored
2
bin/templates/project/assets/www/cordova.js
vendored
@ -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;
|
||||
|
||||
|
2
cordova-js-src/exec.js
vendored
2
cordova-js-src/exec.js
vendored
@ -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;
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user