mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
SecureActivityDelegate: Fix cold-start only lock behavior (#8066)
This commit is contained in:
parent
2d22baba62
commit
467ceacb17
1 changed files with 7 additions and 3 deletions
|
@ -25,8 +25,8 @@ interface SecureActivityDelegate {
|
||||||
companion object {
|
companion object {
|
||||||
fun onApplicationCreated() {
|
fun onApplicationCreated() {
|
||||||
val lockDelay = Injekt.get<SecurityPreferences>().lockAppAfter().get()
|
val lockDelay = Injekt.get<SecurityPreferences>().lockAppAfter().get()
|
||||||
if (lockDelay == 0) {
|
if (lockDelay <= 0) {
|
||||||
// Restore always active app lock
|
// Restore always active/on start app lock
|
||||||
// Delayed lock will be restored later on activity resume
|
// Delayed lock will be restored later on activity resume
|
||||||
lockState = LockState.ACTIVE
|
lockState = LockState.ACTIVE
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,12 @@ interface SecureActivityDelegate {
|
||||||
preferences.lastAppClosed().set(Date().time)
|
preferences.lastAppClosed().set(Date().time)
|
||||||
}
|
}
|
||||||
if (!AuthenticatorUtil.isAuthenticating) {
|
if (!AuthenticatorUtil.isAuthenticating) {
|
||||||
lockState = if (preferences.lockAppAfter().get() >= 0) {
|
val lockAfter = preferences.lockAppAfter().get()
|
||||||
|
lockState = if (lockAfter > 0) {
|
||||||
LockState.PENDING
|
LockState.PENDING
|
||||||
|
} else if (lockAfter == -1) {
|
||||||
|
// Never lock on idle
|
||||||
|
LockState.INACTIVE
|
||||||
} else {
|
} else {
|
||||||
LockState.ACTIVE
|
LockState.ACTIVE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue