Fix issue #2149145: Safe Mode does not work on Sholes device
The APIs for checking whether keys are held down now also look at virtual keys. However it turns out there is less than a second between the time we start the input thread and check for safe mode, so there is not enough time to actually open all of the devices and get the data from them about the finger being down to determine if a virtual key is down. So now you can also hold DPAD center, trackball center, or s to enter safe mode. Also give some vibrator feedback. Change-Id: I55edce63bc0c375813bd3751766b8070beeb0153
This commit is contained in:
@@ -4108,7 +4108,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
"getScancodeState()")) {
|
||||
throw new SecurityException("Requires READ_INPUT_STATE permission");
|
||||
}
|
||||
return KeyInputQueue.getScancodeState(sw);
|
||||
return mQueue.getScancodeState(sw);
|
||||
}
|
||||
|
||||
public int getScancodeStateForDevice(int devid, int sw) {
|
||||
@@ -4116,7 +4116,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
"getScancodeStateForDevice()")) {
|
||||
throw new SecurityException("Requires READ_INPUT_STATE permission");
|
||||
}
|
||||
return KeyInputQueue.getScancodeState(devid, sw);
|
||||
return mQueue.getScancodeState(devid, sw);
|
||||
}
|
||||
|
||||
public int getKeycodeState(int sw) {
|
||||
@@ -4124,7 +4124,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
"getKeycodeState()")) {
|
||||
throw new SecurityException("Requires READ_INPUT_STATE permission");
|
||||
}
|
||||
return KeyInputQueue.getKeycodeState(sw);
|
||||
return mQueue.getKeycodeState(sw);
|
||||
}
|
||||
|
||||
public int getKeycodeStateForDevice(int devid, int sw) {
|
||||
@@ -4132,7 +4132,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
"getKeycodeStateForDevice()")) {
|
||||
throw new SecurityException("Requires READ_INPUT_STATE permission");
|
||||
}
|
||||
return KeyInputQueue.getKeycodeState(devid, sw);
|
||||
return mQueue.getKeycodeState(devid, sw);
|
||||
}
|
||||
|
||||
public boolean hasKeys(int[] keycodes, boolean[] keyExists) {
|
||||
|
||||
Reference in New Issue
Block a user