mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-05 16:58:52 -06:00
Automatic public backup: Fixed for the ktlint
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
|
||||
package org.isoron.uhabits.acceptance.steps
|
||||
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import android.net.Uri
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.By
|
||||
|
||||
@@ -97,4 +97,3 @@ class AutoBackup(private val context: Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ class ExportDBTask(
|
||||
filename = try {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val uriString = prefs.getString("publicBackupFolder", null)
|
||||
// if public backup folder is selected, use it for backup
|
||||
if (uriString != null) {
|
||||
// if public backup folder is selected, use it for backup
|
||||
val uri = Uri.parse(uriString)
|
||||
val dir = if (uri.scheme == "content") {
|
||||
DocumentFile.fromTreeUri(context, uri)
|
||||
@@ -53,8 +53,8 @@ class ExportDBTask(
|
||||
} else {
|
||||
null
|
||||
}
|
||||
// if public backup folder is unset, use default system folder to backup
|
||||
} else {
|
||||
// if public backup folder is unset, use default system folder to backup
|
||||
val dir = system.getFilesDir("Backups") ?: return
|
||||
saveDatabaseCopy(context, dir)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user