CB-11828: Switching default bridge back to ONLINE_BRIDGE

This commit is contained in:
Joe Bowser 2016-09-08 15:29:00 -07:00
parent 3a33f4c0a6
commit deea0f7e4f
3 changed files with 11 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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");
}
}
}