Merge pull request #2864 from konradmoesch/master

Improve PassphraseDialog lifecycle logic
This commit is contained in:
Vincent Breitmoser
2024-01-29 16:03:11 +01:00
committed by GitHub

View File

@@ -129,31 +129,11 @@ public class PassphraseDialogActivity extends FragmentActivity {
finish();
}
}
@Override
protected void onResumeFragments() {
super.onResumeFragments();
/* Show passphrase dialog to cache a new passphrase the user enters for using it later for
* encryption. Based on mSecretKeyId it asks for a passphrase to open a private key or it asks
* for a symmetric passphrase
*/
PassphraseDialogFragment frag = new PassphraseDialogFragment();
frag.setArguments(getIntent().getExtras());
frag.show(getSupportFragmentManager(), "passphraseDialog");
}
@Override
protected void onPause() {
super.onPause();
DialogFragment dialog = (DialogFragment) getSupportFragmentManager().findFragmentByTag("passphraseDialog");
if (dialog != null) {
dialog.dismiss();
}
}
public static class PassphraseDialogFragment extends DialogFragment implements TextView.OnEditorActionListener {
private EditText mPassphraseEditText;
private TextView mPassphraseText;