I think it'd be better to change the default value here:
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/src/org/apache/cordova/NativeToJsMessageQueue.java;h=d2732c46213ac7ae786b5f1a850d42a078b2f6e4;hb=HEAD#l39

and here:
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/src/org/apache/cordova/NativeToJsMessageQueue.java;h=d2732c46213ac7ae786b5f1a850d42a078b2f6e4;hb=HEAD#l39

And get rid of the line you just added:
  69 function androidExec(success, fail, service, action, args) {
  70     // Set default bridge modes if they have not already been set.
  71     if (jsToNativeBridgeMode === undefined) {
  72         androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
  73     }
  74     androidExec.setNativeToJsBridgeMode(nativeToJsModes.ONLINE_EVENT);
  <<<< THIS ONE
  75


Since that prevents anyone from setting it to anything else. :P

Having the defaults set to it mean that there doesn't need to be an
explicit call to set the mode on start-up, so it will be faster.


On Thu, Sep 20, 2012 at 5:38 PM, Joe Bowser <bows...@gmail.com> wrote:

> -    if (nativeToJsBridgeMode === undefined) {
> -        if (callback.isAvailable()) {
> -
>  androidExec.setNativeToJsBridgeMode(nativeToJsModes.HANGING_GET);
> -        } else {
> -            androidExec.setNativeToJsBridgeMode(nativeToJsModes.POLLING);
> -        }
> -    }
> +    androidExec.setNativeToJsBridgeMode(nativeToJsModes.ONLINE_EVENT);
> +
>
> Seriously, I want to get a bunch of these "My app freezes when I go
> offline" errors gone, and it's easier if we don't have to tell users
> to switch the bridge.
>
> Joe
>

Reply via email to