Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af7f2db6 authored by Danesh M's avatar Danesh M Committed by Abhisek Devkota
Browse files

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
(cherry picked from commit 90776c26)
parent 3c4aab4e
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -896,12 +896,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());
@@ -913,6 +908,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();