You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/09/18 19:52:51 UTC

[8/14] android commit: Set the initial network-available state on start-up.

Set the initial network-available state on start-up.

I've been assuming that it always starts as true, but this will ensure
that it does.


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

Branch: refs/heads/master
Commit: ee34f11c29f60ffdb06667471860806169e2e62f
Parents: 6ca6d88
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Sep 7 09:49:24 2012 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Sep 18 13:24:37 2012 -0400

----------------------------------------------------------------------
 .../org/apache/cordova/NativeToJsMessageQueue.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/ee34f11c/framework/src/org/apache/cordova/NativeToJsMessageQueue.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java
index 9ba1562..703baf1 100755
--- a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java
+++ b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java
@@ -187,8 +187,12 @@ public class NativeToJsMessageQueue {
                 }
             }                
         };
-        
+        OnlineEventsBridgeMode() {
+            webView.setNetworkAvailable(true);
+        }
         public void onNativeToJsMessageAvailable() {
+            // TODO(agrieve): consider running this *not* on the main thread, since it just
+            // sends a message under-the-hood anyways.
             cordova.getActivity().runOnUiThread(runnable);
         }
     }