mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
CB-7018 Fix setButtonPlumbedToJs never un-listening
This commit is contained in:
parent
92be0033a8
commit
cd6c0e1de9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user