mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Backup parameters init
This commit is contained in:
@@ -23,6 +23,7 @@ import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
@@ -82,8 +83,8 @@ class PasskeyLauncherActivity : DatabaseModeActivity() {
|
||||
private var mCreationParameters: PublicKeyCredentialCreationParameters? = null
|
||||
private var mPasskey: Passkey? = null
|
||||
|
||||
private val mBackupEligibility = PreferencesUtil.isPasskeyBackupEligibilityEnable(this)
|
||||
private val mBackupState = PreferencesUtil.isPasskeyBackupStateEnable(this)
|
||||
private var mBackupEligibility: Boolean = true
|
||||
private var mBackupState: Boolean = false
|
||||
|
||||
private var mPasskeySelectionActivityResultLauncher: ActivityResultLauncher<Intent>? =
|
||||
this.buildActivityResultLauncher(
|
||||
@@ -172,6 +173,12 @@ class PasskeyLauncherActivity : DatabaseModeActivity() {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
mBackupEligibility = PreferencesUtil.isPasskeyBackupEligibilityEnable(applicationContext)
|
||||
mBackupState = PreferencesUtil.isPasskeyBackupStateEnable(applicationContext)
|
||||
}
|
||||
|
||||
private fun cancelRequest() {
|
||||
setResult(RESULT_CANCELED)
|
||||
finish()
|
||||
|
||||
@@ -693,6 +693,8 @@ object PreferencesUtil {
|
||||
}
|
||||
|
||||
fun isPasskeyBackupStateEnable(context: Context): Boolean {
|
||||
if (!isPasskeyBackupEligibilityEnable(context))
|
||||
return false
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.passkeys_backup_state_key),
|
||||
context.resources.getBoolean(R.bool.passkeys_backup_state_default))
|
||||
|
||||
Reference in New Issue
Block a user