Skip to content

Commit d59df0f

Browse files
committed
Increase background time lock threshold
1 parent 5d387f1 commit d59df0f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/ua/com/radiokot/money/lock/AppLockModule.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ val appLockModule = module {
4444

4545
single {
4646
AppLock(
47+
backgroundLockThresholdMs = 10000,
4748
preferences = get(),
4849
)
4950
} bind AppLock::class

app/src/main/java/ua/com/radiokot/money/lock/logic/AppLock.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import ua.com.radiokot.money.map
3838
* @see MoneyAppActivity.requiresUnlocking
3939
*/
4040
class AppLock(
41+
private val backgroundLockThresholdMs: Long,
4142
private val preferences: AppLockPreferences,
4243
) {
4344
private val log by lazyLogger("AppLock")
@@ -104,7 +105,7 @@ class AppLock(
104105
return
105106
}
106107

107-
if (SystemClock.uptimeMillis() - wentToBackgroundAtMs > 3000) {
108+
if (SystemClock.uptimeMillis() - wentToBackgroundAtMs > backgroundLockThresholdMs) {
108109

109110
log.debug {
110111
"onAppReturnedToForeground(): locking as been in background long enough:" +

0 commit comments

Comments
 (0)