Save missing state in ConfirmAutoSyncChangeFragment

Bug: 18117345
Change-Id: I5f176f330e51b23fe0935d435aa8bc3904e42d36
This commit is contained in:
Alexandra Gherghina
2014-11-04 14:06:47 +00:00
parent a7b5d2b384
commit 6911af1cbe

View File

@@ -536,6 +536,7 @@ public class AccountSettings extends SettingsPreferenceFragment
*/ */
public static class ConfirmAutoSyncChangeFragment extends DialogFragment { public static class ConfirmAutoSyncChangeFragment extends DialogFragment {
private static final String SAVE_ENABLING = "enabling"; private static final String SAVE_ENABLING = "enabling";
private static final String SAVE_USER_HANDLE = "userHandle";
private boolean mEnabling; private boolean mEnabling;
private UserHandle mUserHandle; private UserHandle mUserHandle;
@@ -554,6 +555,7 @@ public class AccountSettings extends SettingsPreferenceFragment
final Context context = getActivity(); final Context context = getActivity();
if (savedInstanceState != null) { if (savedInstanceState != null) {
mEnabling = savedInstanceState.getBoolean(SAVE_ENABLING); mEnabling = savedInstanceState.getBoolean(SAVE_ENABLING);
mUserHandle = (UserHandle) savedInstanceState.getParcelable(SAVE_USER_HANDLE);
} }
final AlertDialog.Builder builder = new AlertDialog.Builder(context); final AlertDialog.Builder builder = new AlertDialog.Builder(context);
@@ -581,6 +583,7 @@ public class AccountSettings extends SettingsPreferenceFragment
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
outState.putBoolean(SAVE_ENABLING, mEnabling); outState.putBoolean(SAVE_ENABLING, mEnabling);
outState.putParcelable(SAVE_USER_HANDLE, mUserHandle);
} }
} }
// TODO Implement a {@link SearchIndexProvider} to allow Indexing and Search of account types // TODO Implement a {@link SearchIndexProvider} to allow Indexing and Search of account types