Backup pref related fixes.

This commit is contained in:
Anton Chekulaev 2020-09-16 19:16:47 +10:00
parent e0892853a7
commit bf666f0296
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_backup_enabled"
android:key="pref_backup_enabled_v2"
android:title="@string/preferences_chats__chat_backups"
android:summary="@string/preferences_chats__backup_chats_to_external_storage" />
@ -102,7 +102,7 @@
android:key="pref_backup_create"
android:title="@string/preferences_chats__create_backup"
android:persistent="false"
android:dependency="pref_backup_enabled"
android:dependency="pref_backup_enabled_v2"
tools:summary="Last backup: 3 days ago" />
</PreferenceCategory>

View File

@ -40,7 +40,7 @@ object BackupUtil {
@Throws(IOException::class)
fun enableBackups(context: Context, password: String) {
val backupDir = getBackupDirUri(context)
if (backupDir == null || validateDirAccess(context, backupDir)) {
if (backupDir == null || !validateDirAccess(context, backupDir)) {
throw IOException("Backup dir is not set or invalid.")
}