Permalink
Browse files

[1/2] Base: Hide power menu on secure lockscreen

Adds an option to enable/disable power menu on secure lockscreen.

PureNexus Edits:
*made multiuser friendly
  • Loading branch information...
Altaf-Mahdi authored and xlxfoxxlx committed Oct 24, 2015
1 parent 50d8a2a commit 28ab69a0d2b7a2d60c95bfc5e8c3d4e5003d05bf
@@ -3759,6 +3759,12 @@ public boolean validate(String value) {
*/
public static final String KEYGUARD_TOGGLE_TORCH = "keyguard_toggle_torch";
/**
* This preference enables showing the power menu on LockScreen.
* @hide
*/
public static final String LOCKSCREEN_ENABLE_POWER_MENU = "lockscreen_enable_power_menu";
/**
* Whether to show media art on lockscreen
* @hide
@@ -1546,7 +1546,14 @@ private void powerLongPress() {
if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) {
performAuditoryFeedbackForAccessibilityIfNeed();
}
boolean locked = isStatusBarKeyguard() && isKeyguardSecure(mCurrentUserId);
boolean globalActionsOnLockScreen = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.LOCKSCREEN_ENABLE_POWER_MENU, 1, UserHandle.USER_CURRENT) == 1;
if (locked && !globalActionsOnLockScreen) {
behavior = LONG_PRESS_POWER_NOTHING;
} else {
showGlobalActionsInternal();
}
break;
case LONG_PRESS_POWER_SHUT_OFF:
case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM:

0 comments on commit 28ab69a

Please sign in to comment.