CB-7018 Fix setButtonPlumbedToJs never un-listening

This commit is contained in:
Andrew Grieve 2014-07-18 13:46:29 -04:00
parent 92be0033a8
commit cd6c0e1de9

View File

@ -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?
if (override) {
boundKeyCodes.add(keyCode);
} else {
boundKeyCodes.remove(keyCode);
}
return;
default:
throw new IllegalArgumentException("Unsupported keycode: " + keyCode);