From d5f597f077eb728f66aa4befd99c66b870dd05c1 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Fri, 27 Mar 2015 09:10:33 +0100 Subject: Don't save dialog changes when hitting 'cancel'. Change-Id: I202007c1558a981cec467d7258b699b39beec51f --- .../android/settings/profiles/SetupActionsFragment.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index af90304..a2f41fe 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -687,12 +687,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment override.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - streamSettings.setOverride(isChecked); seekBar.setEnabled(isChecked); - - mProfile.setStreamSettings(streamSettings); - mAdapter.notifyDataSetChanged(); - updateProfile(); } }); seekBar.setEnabled(streamSettings.isOverride()); @@ -703,19 +698,14 @@ public class SetupActionsFragment extends SettingsPreferenceFragment @Override public void onClick(DialogInterface dialog, int which) { int value = seekBar.getProgress(); + streamSettings.setOverride(override.isChecked()); streamSettings.setValue(value); mProfile.setStreamSettings(streamSettings); mAdapter.notifyDataSetChanged(); updateProfile(); - dialog.dismiss(); - } - }); - builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); } }); + builder.setNegativeButton(android.R.string.cancel, null); builder.show(); } -- cgit v1.1