From eede8c5bdc5fd31dc55d389b36dac16441973dbe Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 Aug 2020 13:29:47 +0200 Subject: [PATCH] Save/restore certificate alias --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 4 ++++ app/src/main/java/eu/faircode/email/FragmentIdentity.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index bf85c6800e..65b0f746cc 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -1398,6 +1398,7 @@ public class FragmentAccount extends FragmentBase { @Override public void onSaveInstanceState(Bundle outState) { outState.putInt("fair:provider", spProvider.getSelectedItemPosition()); + outState.putString("fair:certificate", certificate); outState.putString("fair:password", tilPassword.getEditText().getText().toString()); outState.putInt("fair:advanced", grpAdvanced.getVisibility()); outState.putInt("fair:auth", auth); @@ -1538,6 +1539,9 @@ public class FragmentAccount extends FragmentBase { spProvider.setTag(p); spProvider.setSelection(p); + certificate = savedInstanceState.getString("fair:certificate"); + tvCertificate.setText(certificate == null ? getString(R.string.title_optional) : certificate); + tilPassword.getEditText().setText(savedInstanceState.getString("fair:password")); grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced")); auth = savedInstanceState.getInt("fair:auth"); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index fec9c31fc5..6d5656fef5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -1047,6 +1047,7 @@ public class FragmentIdentity extends FragmentBase { public void onSaveInstanceState(Bundle outState) { outState.putInt("fair:account", spAccount.getSelectedItemPosition()); outState.putInt("fair:provider", spProvider.getSelectedItemPosition()); + outState.putString("fair:certificate", certificate); outState.putString("fair:password", tilPassword.getEditText().getText().toString()); outState.putInt("fair:advanced", grpAdvanced.getVisibility()); outState.putInt("fair:auth", auth); @@ -1153,6 +1154,9 @@ public class FragmentIdentity extends FragmentBase { } }.execute(FragmentIdentity.this, new Bundle(), "identity:count"); } else { + certificate = savedInstanceState.getString("fair:certificate"); + tvCertificate.setText(certificate == null ? getString(R.string.title_optional) : certificate); + tilPassword.getEditText().setText(savedInstanceState.getString("fair:password")); grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced")); auth = savedInstanceState.getInt("fair:auth");