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:
@@ -365,8 +365,17 @@ class ServerThread extends Thread {
|
||||
mContentResolver.registerContentObserver(Settings.Secure.getUriFor(Settings.Secure.ADB_ENABLED),
|
||||
false, new AdbSettingsObserver());
|
||||
|
||||
// It is now time to start up the app processes...
|
||||
// Before things start rolling, be sure we have decided whether
|
||||
// we are in safe mode.
|
||||
final boolean safeMode = wm.detectSafeMode();
|
||||
if (safeMode) {
|
||||
try {
|
||||
ActivityManagerNative.getDefault().enterSafeMode();
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
// It is now time to start up the app processes...
|
||||
|
||||
if (notification != null) {
|
||||
notification.systemReady();
|
||||
|
||||
Reference in New Issue
Block a user