Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc1ba072 authored by Danesh M's avatar Danesh M
Browse files

ActivityManager : Remove POWER_OFF_ALARM_MODE HOME_KEY button override

This is being removed for 2 reasons :
1) The feature sometimes enters in an inconsistent state where
user is stuck in this mode even when its unintential. This is
addressed by http://review.cyanogenmod.org/#/c/133956/

2) There is a security concern regarding this being in System table.
This means any third party app can toggle this setting and keep
the user from exiting their app.

Change-Id: I36393bda81e087264629d801b4bdf62b11837187
CYNGNOS-2119
(cherry picked from commit 1291c93f)
parent 96cb2fbe
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -3167,19 +3167,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    + " canceled=" + canceled);
        }

        // If the boot mode is power off alarm, we should not dispatch the several physical keys
        // in power off alarm UI to avoid pausing power off alarm UI.
        int isPowerOffAlarmMode = Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.POWER_OFF_ALARM_MODE, 0);
        if (DEBUG_INPUT) { Log.d(TAG, "intercept Dispatching isPowerOffAlarmMode = " +
                isPowerOffAlarmMode); }

        if (isPowerOffAlarmMode == 1 && (keyCode == KeyEvent.KEYCODE_HOME
                || keyCode == KeyEvent.KEYCODE_SEARCH
                || keyCode == KeyEvent.KEYCODE_MENU)) {
            return -1;  // ignore the physical key here
        }

        // If we think we might have a volume down & power key chord on the way
        // but we're not sure, then tell the dispatcher to wait a little while and
        // try again later before dispatching.