Loading core/java/android/provider/Settings.java +14 −0 Original line number Diff line number Diff line Loading @@ -2675,12 +2675,24 @@ public final class Settings { */ public static final String SYSTEM_PROFILES_ENABLED = "system_profiles_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_REBOOT_ENABLED = "power_menu_reboot_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_SCREENSHOT_ENABLED = "power_menu_screenshot_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_PROFILES_ENABLED = "power_menu_profiles_enabled"; /** * Whether to enable custom rebindings of the actions performed on * certain key press events. Loading Loading @@ -2836,6 +2848,8 @@ public final class Settings { LOCKSCREEN_ALWAYS_SHOW_BATTERY, SYSTEM_PROFILES_ENABLED, POWER_MENU_SCREENSHOT_ENABLED, POWER_MENU_REBOOT_ENABLED, POWER_MENU_PROFILES_ENABLED, LOCKSCREEN_VIBRATE_ENABLED, }; Loading policy/src/com/android/internal/policy/impl/GlobalActions.java +28 −20 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }); // next: reboot // only shown if enabled, enabled by default if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.POWER_MENU_REBOOT_ENABLED, 1) == 1) { mItems.add( new SinglePressAction(R.drawable.ic_lock_reboot, R.string.global_action_reboot) { public void onPress() { Loading @@ -273,10 +276,14 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac return true; } }); } // next: profile - only shown if enabled, enabled by default if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) { // next: profile // only shown if both system profiles and the menu item is enabled, enabled by default if ((Settings.System.getInt(mContext.getContentResolver(), Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) && (Settings.System.getInt(mContext.getContentResolver(), Settings.System.POWER_MENU_PROFILES_ENABLED, 1) == 1)) { mItems.add( new ProfileChooseAction() { public void onPress() { Loading @@ -297,7 +304,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }); } // next: screenshot - only shown if enabled, disabled by default // next: screenshot // only shown if enabled, disabled by default if (Settings.System.getInt(mContext.getContentResolver(), POWER_MENU_SCREENSHOT_ENABLED, 0) == 1) { mItems.add( Loading Loading
core/java/android/provider/Settings.java +14 −0 Original line number Diff line number Diff line Loading @@ -2675,12 +2675,24 @@ public final class Settings { */ public static final String SYSTEM_PROFILES_ENABLED = "system_profiles_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_REBOOT_ENABLED = "power_menu_reboot_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_SCREENSHOT_ENABLED = "power_menu_screenshot_enabled"; /** * Whether power menu screenshot is enabled * @hide */ public static final String POWER_MENU_PROFILES_ENABLED = "power_menu_profiles_enabled"; /** * Whether to enable custom rebindings of the actions performed on * certain key press events. Loading Loading @@ -2836,6 +2848,8 @@ public final class Settings { LOCKSCREEN_ALWAYS_SHOW_BATTERY, SYSTEM_PROFILES_ENABLED, POWER_MENU_SCREENSHOT_ENABLED, POWER_MENU_REBOOT_ENABLED, POWER_MENU_PROFILES_ENABLED, LOCKSCREEN_VIBRATE_ENABLED, }; Loading
policy/src/com/android/internal/policy/impl/GlobalActions.java +28 −20 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }); // next: reboot // only shown if enabled, enabled by default if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.POWER_MENU_REBOOT_ENABLED, 1) == 1) { mItems.add( new SinglePressAction(R.drawable.ic_lock_reboot, R.string.global_action_reboot) { public void onPress() { Loading @@ -273,10 +276,14 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac return true; } }); } // next: profile - only shown if enabled, enabled by default if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) { // next: profile // only shown if both system profiles and the menu item is enabled, enabled by default if ((Settings.System.getInt(mContext.getContentResolver(), Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) && (Settings.System.getInt(mContext.getContentResolver(), Settings.System.POWER_MENU_PROFILES_ENABLED, 1) == 1)) { mItems.add( new ProfileChooseAction() { public void onPress() { Loading @@ -297,7 +304,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }); } // next: screenshot - only shown if enabled, disabled by default // next: screenshot // only shown if enabled, disabled by default if (Settings.System.getInt(mContext.getContentResolver(), POWER_MENU_SCREENSHOT_ENABLED, 0) == 1) { mItems.add( Loading