From 8218d8f26797b00c4fb4975ed98a39565ed4a44d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 12 May 2022 14:44:10 +0200 Subject: [PATCH] Typo: isStucked -> isStuck --- .../sdk/api/session/crypto/keysbackup/KeysBackupService.kt | 2 +- .../internal/crypto/keysbackup/DefaultKeysBackupService.kt | 6 +++--- .../internal/crypto/keysbackup/KeysBackupStateManager.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt index 824ed1b992..dc8b03eaae 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt @@ -207,7 +207,7 @@ interface KeysBackupService { get() = keysBackupVersion?.version fun isEnabled(): Boolean - fun isStucked(): Boolean + fun isStuck(): Boolean fun getState(): KeysBackupState // For gossiping diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt index fe63529547..1319e54e32 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt @@ -139,7 +139,7 @@ internal class DefaultKeysBackupService @Inject constructor( override fun isEnabled(): Boolean = keysBackupStateManager.isEnabled - override fun isStucked(): Boolean = keysBackupStateManager.isStucked + override fun isStuck(): Boolean = keysBackupStateManager.isStuck override fun getState(): KeysBackupState = keysBackupStateManager.state @@ -909,7 +909,7 @@ internal class DefaultKeysBackupService @Inject constructor( */ fun maybeBackupKeys() { when { - isStucked() -> { + isStuck() -> { // If not already done, or in error case, check for a valid backup version on the homeserver. // If there is one, maybeBackupKeys will be called again. checkAndStartKeysBackup() @@ -1012,7 +1012,7 @@ internal class DefaultKeysBackupService @Inject constructor( } override fun checkAndStartKeysBackup() { - if (!isStucked()) { + if (!isStuck()) { // Try to start or restart the backup only if it is in unknown or bad state Timber.w("checkAndStartKeysBackup: invalid state: ${getState()}") diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupStateManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupStateManager.kt index 78ef958bbf..0614eceb16 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupStateManager.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupStateManager.kt @@ -49,7 +49,7 @@ internal class KeysBackupStateManager(private val uiHandler: Handler) { state == KeysBackupState.BackingUp // True if unknown or bad state - val isStucked: Boolean + val isStuck: Boolean get() = state == KeysBackupState.Unknown || state == KeysBackupState.Disabled || state == KeysBackupState.WrongBackUpVersion ||