mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-25 08:16:07 +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
|
* 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.
|
* 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();
|
return !(this instanceof MainActivity) && !(this instanceof AuthActivity) && _app.isVaultLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,11 @@ public class AuthActivity extends AegisActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent intent = getIntent();
|
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");
|
_cancelAction = (CancelAction) intent.getSerializableExtra("cancelAction");
|
||||||
_slots = (SlotList) intent.getSerializableExtra("slots");
|
_slots = (SlotList) intent.getSerializableExtra("slots");
|
||||||
_stateless = _slots != null;
|
_stateless = _slots != null;
|
||||||
|
@ -190,11 +194,12 @@ public class AuthActivity extends AegisActivity {
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (_bioKey == null || _prefs.isPasswordReminderNeeded()) {
|
boolean remindPassword = _prefs.isPasswordReminderNeeded();
|
||||||
|
if (_bioKey == null || remindPassword) {
|
||||||
focusPasswordField();
|
focusPasswordField();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_bioKey != null && _bioPrompt == null && !_inhibitBioPrompt) {
|
if (_bioKey != null && _bioPrompt == null && !_inhibitBioPrompt && !remindPassword) {
|
||||||
_bioPrompt = showBiometricPrompt();
|
_bioPrompt = showBiometricPrompt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,6 +223,11 @@ public class AuthActivity extends AegisActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isOrphan() {
|
||||||
|
return _stateless && super.isOrphan();
|
||||||
|
}
|
||||||
|
|
||||||
private void focusPasswordField() {
|
private void focusPasswordField() {
|
||||||
_textPassword.requestFocus();
|
_textPassword.requestFocus();
|
||||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||||
|
|
|
@ -491,7 +491,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_app.isVaultLocked()) {
|
if (_app.isVaultLocked()) {
|
||||||
startAuthActivity(true);
|
startAuthActivity(false);
|
||||||
} else if (_loaded) {
|
} else if (_loaded) {
|
||||||
// update the list of groups in the filter menu
|
// update the list of groups in the filter menu
|
||||||
if (_menu != null) {
|
if (_menu != null) {
|
||||||
|
@ -753,7 +753,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
||||||
_loaded = false;
|
_loaded = false;
|
||||||
|
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
startAuthActivity(false);
|
startAuthActivity(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onLocked();
|
super.onLocked();
|
||||||
|
|
Loading…
Add table
Reference in a new issue