Fix behavior of AuthActivity under certain conditions

- Properly use 'inhibitBioPrompt'
- Don't show the biometric prompt when a password reminder is needed
This commit is contained in:
Alexander Bakker 2020-07-05 19:49:51 +02:00
parent 57ef52d6ff
commit ba3e6203ec
3 changed files with 16 additions and 6 deletions

View file

@ -84,7 +84,11 @@ public class AuthActivity extends AegisActivity {
});
Intent intent = getIntent();
_inhibitBioPrompt = savedInstanceState == null ? !intent.getBooleanExtra("_inhibitBioPrompt", true) : savedInstanceState.getBoolean("_inhibitBioPrompt");
if (savedInstanceState == null) {
_inhibitBioPrompt = intent.getBooleanExtra("inhibitBioPrompt", false);
} else {
_inhibitBioPrompt = savedInstanceState.getBoolean("inhibitBioPrompt", false);
}
_cancelAction = (CancelAction) intent.getSerializableExtra("cancelAction");
_slots = (SlotList) intent.getSerializableExtra("slots");
_stateless = _slots != null;
@ -207,11 +211,12 @@ public class AuthActivity extends AegisActivity {
public void onResume() {
super.onResume();
if (_bioKey == null || _prefs.isPasswordReminderNeeded()) {
boolean remindPassword = _prefs.isPasswordReminderNeeded();
if (_bioKey == null || remindPassword) {
focusPasswordField();
}
if (_bioKey != null && _bioPrompt == null && !_inhibitBioPrompt) {
if (_bioKey != null && _bioPrompt == null && !_inhibitBioPrompt && !remindPassword) {
_bioPrompt = showBiometricPrompt();
}
@ -235,6 +240,11 @@ public class AuthActivity extends AegisActivity {
}
}
@Override
protected boolean isOrphan() {
return _stateless && super.isOrphan();
}
private void focusPasswordField() {
_textPassword.requestFocus();
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);