mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-25 00:06:08 +00:00
Merge pull request #529 from alexbakker/fix-bioprompt-mixup
Fix behavior of AuthActivity under certain conditions
This commit is contained in:
commit
7e403c2af6
3 changed files with 16 additions and 6 deletions
|
@ -150,7 +150,7 @@ public abstract class AegisActivity extends AppCompatActivity implements AegisAp
|
|||
* Reports whether this Activity instance has become an orphan. This can happen if
|
||||
* the vault was locked by an external trigger while the Activity was still open.
|
||||
*/
|
||||
private boolean isOrphan() {
|
||||
protected boolean isOrphan() {
|
||||
return !(this instanceof MainActivity) && !(this instanceof AuthActivity) && _app.isVaultLocked();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,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;
|
||||
|
@ -190,11 +194,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();
|
||||
}
|
||||
|
||||
|
@ -218,6 +223,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);
|
||||
|
|
|
@ -491,7 +491,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
|
||||
if (_app.isVaultLocked()) {
|
||||
startAuthActivity(true);
|
||||
startAuthActivity(false);
|
||||
} else if (_loaded) {
|
||||
// update the list of groups in the filter menu
|
||||
if (_menu != null) {
|
||||
|
@ -753,7 +753,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
_loaded = false;
|
||||
|
||||
if (isOpen()) {
|
||||
startAuthActivity(false);
|
||||
startAuthActivity(true);
|
||||
}
|
||||
|
||||
super.onLocked();
|
||||
|
|
Loading…
Add table
Reference in a new issue