mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-06 00:32:32 -08:00
fix: Background event
This commit is contained in:
3 files changed
+5
-3
No files matched your search
@@ -21,7 +21,6 @@ package com.kunzisoft.keepass.services
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.core.app.ServiceCompat
|
||||
import com.kunzisoft.keepass.app.AppLifecycleObserver
|
||||
import com.kunzisoft.keepass.timeout.TimeoutHelper
|
||||
import com.kunzisoft.keepass.utils.LockReceiver
|
||||
import com.kunzisoft.keepass.utils.registerLockReceiver
|
||||
@@ -36,7 +35,6 @@ abstract class LockNotificationService : NotificationService() {
|
||||
protected open fun actionOnLock() {
|
||||
// Stop the service in all cases
|
||||
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
|
||||
AppLifecycleObserver.lockBackgroundEvent = false
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.os.Build
|
||||
import android.util.Log
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.app.AppLifecycleObserver
|
||||
import com.kunzisoft.keepass.database.ContextualDatabase
|
||||
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
|
||||
import com.kunzisoft.keepass.services.ClipboardEntryNotificationService
|
||||
@@ -105,6 +106,7 @@ class LockReceiver(private var lockAction: () -> Unit) : BroadcastReceiver() {
|
||||
}
|
||||
LOCK_ACTION -> {
|
||||
lockAction.invoke()
|
||||
AppLifecycleObserver.lockBackgroundEvent = false
|
||||
if (PreferencesUtil.isKeyboardPreviousLockEnable(context)) {
|
||||
backToPreviousKeyboardAction?.invoke()
|
||||
} else {}
|
||||
|
||||
@@ -55,7 +55,9 @@ class DeviceUnlockViewModel(application: Application): AndroidViewModel(applicat
|
||||
AppLifecycleObserver.appJustLaunched
|
||||
.onEach {
|
||||
isAutoOpenBiometricPromptAllowed = true
|
||||
}.launchIn(viewModelScope)
|
||||
checkUnlockAvailability()
|
||||
}
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
fun checkConditionToStoreCredential(condition: Boolean) {
|
||||
|
||||
Reference in new issue
Block a user