From cb0ec54adc27efffcf107b1b0dee0495da09ddca Mon Sep 17 00:00:00 2001 From: Yuta Yamada Date: Thu, 7 Jul 2016 18:10:05 +0900 Subject: [PATCH] Show QS data saver info dialog until enabled Currently the quick settings 'data saver' info dialog is only shown once when the quick settings button is tapped, regardless of whether the end user selects OK or cancel. This commit changes the behaviour slightly where the feature info will be displayed until the end user has actually enabled the feature for the first time. Bug: 153108714 Test: Manual Change-Id: I0fb44fc388bc7dcf8ae35eb60c52c09ce0317828 --- .../src/com/android/systemui/qs/tiles/DataSaverTile.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java index 79996bcfa8089..29c6a5f94122b 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java @@ -70,11 +70,13 @@ public class DataSaverTile extends QSTileImpl implements dialog.setTitle(com.android.internal.R.string.data_saver_enable_title); dialog.setMessage(com.android.internal.R.string.data_saver_description); dialog.setPositiveButton(com.android.internal.R.string.data_saver_enable_button, - (OnClickListener) (dialogInterface, which) -> toggleDataSaver()); + (OnClickListener) (dialogInterface, which) -> { + toggleDataSaver(); + Prefs.putBoolean(mContext, Prefs.Key.QS_DATA_SAVER_DIALOG_SHOWN, true); + }); dialog.setNegativeButton(com.android.internal.R.string.cancel, null); dialog.setShowForAllUsers(true); dialog.show(); - Prefs.putBoolean(mContext, Prefs.Key.QS_DATA_SAVER_DIALOG_SHOWN, true); } private void toggleDataSaver() {