cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/3] android commit: CB-7018 Fix setButtonPlumbedToJs never un-listening
Date Fri, 18 Jul 2014 17:49:14 GMT
CB-7018 Fix setButtonPlumbedToJs never un-listening


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

Branch: refs/heads/master
Commit: cd6c0e1de9d665715988348866f6d71a683251cb
Parents: 92be003
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jul 18 13:46:29 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jul 18 13:46:29 2014 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaWebView.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/cd6c0e1d/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index f74d5e1..72aa171 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -689,13 +689,17 @@ public class CordovaWebView extends WebView {
         return super.onKeyUp(keyCode, event);
     }
 
-    public void setButtonPlumbedToJs(int keyCode, boolean value) {
+    public void setButtonPlumbedToJs(int keyCode, boolean override) {
         switch (keyCode) {
             case KeyEvent.KEYCODE_VOLUME_DOWN:
             case KeyEvent.KEYCODE_VOLUME_UP:
             case KeyEvent.KEYCODE_BACK:
                 // TODO: Why are search and menu buttons handled separately?
-                boundKeyCodes.add(keyCode);
+                if (override) {
+                    boundKeyCodes.add(keyCode);
+                } else {
+                    boundKeyCodes.remove(keyCode);
+                }
                 return;
             default:
                 throw new IllegalArgumentException("Unsupported keycode: " + keyCode);


Mime
View raw message