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