Loading packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +13 −5 Original line number Diff line number Diff line Loading @@ -484,16 +484,24 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { d.setMessage(mContext.getString(R.string.auto_saver_enabled_text, getLowBatteryAutoTriggerDefaultLevel())); // Negative == "got it". Just close the dialog. Battery saver has already been enabled. d.setNegativeButton(R.string.auto_saver_okay_action, null); d.setPositiveButton(R.string.open_saver_setting_action, (dialog, which) -> mContext.startActivity(actionBatterySaverSetting)); // "Got it". Just close the dialog. Automatic battery has been enabled already. d.setPositiveButton(R.string.auto_saver_okay_action, (dialog, which) -> onAutoSaverEnabledConfirmationClosed()); // "Settings" -> Opens the battery saver settings activity. d.setNeutralButton(R.string.open_saver_setting_action, (dialog, which) -> { mContext.startActivity(actionBatterySaverSetting); onAutoSaverEnabledConfirmationClosed(); }); d.setShowForAllUsers(true); d.setOnDismissListener((dialog) -> mSaverEnabledConfirmation = null); d.setOnDismissListener((dialog) -> onAutoSaverEnabledConfirmationClosed()); d.show(); mSaverEnabledConfirmation = d; } private void onAutoSaverEnabledConfirmationClosed() { mSaverEnabledConfirmation = null; } private void setSaverMode(boolean mode, boolean needFirstTimeWarning) { BatterySaverUtils.setPowerSaveMode(mContext, mode, needFirstTimeWarning); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java +4 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,10 @@ public class SystemUIDialog extends AlertDialog { setButton(BUTTON_NEGATIVE, mContext.getString(resId), onClick); } public void setNeutralButton(int resId, OnClickListener onClick) { setButton(BUTTON_NEUTRAL, mContext.getString(resId), onClick); } public static void setShowForAllUsers(Dialog dialog, boolean show) { if (show) { dialog.getWindow().getAttributes().privateFlags |= Loading Loading
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +13 −5 Original line number Diff line number Diff line Loading @@ -484,16 +484,24 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { d.setMessage(mContext.getString(R.string.auto_saver_enabled_text, getLowBatteryAutoTriggerDefaultLevel())); // Negative == "got it". Just close the dialog. Battery saver has already been enabled. d.setNegativeButton(R.string.auto_saver_okay_action, null); d.setPositiveButton(R.string.open_saver_setting_action, (dialog, which) -> mContext.startActivity(actionBatterySaverSetting)); // "Got it". Just close the dialog. Automatic battery has been enabled already. d.setPositiveButton(R.string.auto_saver_okay_action, (dialog, which) -> onAutoSaverEnabledConfirmationClosed()); // "Settings" -> Opens the battery saver settings activity. d.setNeutralButton(R.string.open_saver_setting_action, (dialog, which) -> { mContext.startActivity(actionBatterySaverSetting); onAutoSaverEnabledConfirmationClosed(); }); d.setShowForAllUsers(true); d.setOnDismissListener((dialog) -> mSaverEnabledConfirmation = null); d.setOnDismissListener((dialog) -> onAutoSaverEnabledConfirmationClosed()); d.show(); mSaverEnabledConfirmation = d; } private void onAutoSaverEnabledConfirmationClosed() { mSaverEnabledConfirmation = null; } private void setSaverMode(boolean mode, boolean needFirstTimeWarning) { BatterySaverUtils.setPowerSaveMode(mContext, mode, needFirstTimeWarning); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java +4 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,10 @@ public class SystemUIDialog extends AlertDialog { setButton(BUTTON_NEGATIVE, mContext.getString(resId), onClick); } public void setNeutralButton(int resId, OnClickListener onClick) { setButton(BUTTON_NEUTRAL, mContext.getString(resId), onClick); } public static void setShowForAllUsers(Dialog dialog, boolean show) { if (show) { dialog.getWindow().getAttributes().privateFlags |= Loading