From 037b0f8ad43d570f97dbf49848dab7c8b6b38513 Mon Sep 17 00:00:00 2001 From: Danesh M Date: Wed, 30 Sep 2015 18:30:17 -0700 Subject: ProfileSettings : Ensure brightness settings only apply on accept If the user clicks cancel, changes should not persist. Repro: 1) Edit current profile 2) Change brightness via override 3) Press cancel issue-id: CYNGNOS-1174 Change-Id: I6a09c642cd22509161efa5565276ea9c06973f5e --- src/com/android/settings/profiles/SetupActionsFragment.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/com/android/settings/profiles') diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index e9f0076..7a433b4 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -895,12 +895,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment override.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - brightnessSettings.setOverride(isChecked); seekBar.setEnabled(isChecked); - - mProfile.setBrightness(brightnessSettings); - mAdapter.notifyDataSetChanged(); - updateProfile(); } }); seekBar.setEnabled(brightnessSettings.isOverride()); @@ -912,6 +907,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment public void onClick(DialogInterface dialog, int which) { int value = seekBar.getProgress(); brightnessSettings.setValue(value); + brightnessSettings.setOverride(override.isChecked()); mProfile.setBrightness(brightnessSettings); mAdapter.notifyDataSetChanged(); updateProfile(); -- cgit v1.1