sanders: Update KeyHandler for AOSP
Signed-off-by: Jorge Lucas <jorgelucas.sd@gmail.com>
This commit is contained in:
@@ -417,7 +417,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleKeyEvent(KeyEvent event) {
|
public KeyEvent handleKeyEvent(KeyEvent event) {
|
||||||
int scanCode = event.getScanCode();
|
int scanCode = event.getScanCode();
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
@@ -431,7 +431,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
|
|
||||||
boolean isFPScanCode = ArrayUtils.contains(sSupportedFPGestures, scanCode);
|
boolean isFPScanCode = ArrayUtils.contains(sSupportedFPGestures, scanCode);
|
||||||
if (!isFPScanCode) {
|
if (!isFPScanCode) {
|
||||||
return false;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isFPGestureEnabled = FileUtils.readOneLine(FP_HOME_NODE).equals("1");
|
boolean isFPGestureEnabled = FileUtils.readOneLine(FP_HOME_NODE).equals("1");
|
||||||
@@ -441,12 +441,12 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
|
|
||||||
// We only want ACTION_UP event
|
// We only want ACTION_UP event
|
||||||
if (event.getAction() != KeyEvent.ACTION_UP) {
|
if (event.getAction() != KeyEvent.ACTION_UP) {
|
||||||
return true;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFPScanCode){
|
if (isFPScanCode){
|
||||||
if (fpGesturePending) {
|
if (fpGesturePending) {
|
||||||
return false;
|
return event;
|
||||||
} else {
|
} else {
|
||||||
resetFPGestureDelay();
|
resetFPGestureDelay();
|
||||||
fpGesturePending = true;
|
fpGesturePending = true;
|
||||||
@@ -461,7 +461,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
if (isFPScanCode) {
|
if (isFPScanCode) {
|
||||||
if ((!isFPGestureEnabled) || (!isScreenOn && !isFPGestureEnabledOnScreenOff)) {
|
if ((!isFPGestureEnabled) || (!isScreenOn && !isFPGestureEnabledOnScreenOff)) {
|
||||||
resetDoubleTapOnFP();
|
resetDoubleTapOnFP();
|
||||||
return false;
|
return event;
|
||||||
}
|
}
|
||||||
if (!isScreenOn && isFPGestureEnabledOnScreenOff) {
|
if (!isScreenOn && isFPGestureEnabledOnScreenOff) {
|
||||||
processFPScreenOffScancode(scanCode);
|
processFPScreenOffScancode(scanCode);
|
||||||
@@ -469,7 +469,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
processFPScancode(scanCode);
|
processFPScancode(scanCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processFPScancode(int scanCode) {
|
private void processFPScancode(int scanCode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user