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/08/22 15:42:02 UTC

[3/4] js commit: [android] Use constants for bridge modes in place of literals.

[android] Use constants for bridge modes in place of literals.


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

Branch: refs/heads/master
Commit: 8e03c2257827d9f9b14e771a2f829db566719db9
Parents: 93c7c2d
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Aug 21 11:46:20 2012 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 22 09:41:12 2012 -0400

----------------------------------------------------------------------
 lib/android/exec.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/8e03c225/lib/android/exec.js
----------------------------------------------------------------------
diff --git a/lib/android/exec.js b/lib/android/exec.js
index 4c817f4..43bcd5f 100644
--- a/lib/android/exec.js
+++ b/lib/android/exec.js
@@ -120,17 +120,17 @@ androidExec.setNativeToJsBridgeMode = function(mode) {
     if (mode == nativeToJsBridgeMode) {
         return;
     }
-    if (nativeToJsBridgeMode == 0) {
+    if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
         polling.stop();
-    } else if (nativeToJsBridgeMode == 1) {
+    } else if (nativeToJsBridgeMode == nativeToJsModes.HANGING_GET) {
         callback.stop();
     }
     nativeToJsBridgeMode = mode;
     // Tell the native side to switch modes.
     prompt(mode, "gap_bridge_mode:");
-    if (mode == 0) {
+    if (mode == nativeToJsModes.POLLING) {
         polling.start();
-    } else if (mode == 1) {
+    } else if (mode == nativeToJsModes.HANGING_GET) {
         callback.start();
     }
 };