diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MigrateEssentialFiles.kt b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MigrateEssentialFiles.kt index 61ef6000baf3..afa83024efc0 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MigrateEssentialFiles.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MigrateEssentialFiles.kt @@ -48,11 +48,11 @@ import java.io.File * * See: [migrateFiles] * - * Preconditions (verified inside [migrateEssentialFiles] and [migrateFiles] - exceptions thrown if not met): + * Preconditions (verified inside [MigrateEssentialFiles] and [migrateFiles] - exceptions thrown if not met): * * Collection is not corrupt and can be opened * * Collection basic check passes [UserActionRequiredException.CheckDatabaseException] * * Collection can be closed and locked - * * User has space to move files [UserActionRequiredException.OutOfSpaceException] (the size of essential files + [SAFETY_MARGIN_BYTES] + * * User has space to move files [UserActionRequiredException.OutOfSpaceException] (the size of essential files + [ScopedStorageService.SAFETY_MARGIN_BYTES] * * A migration is not currently taking place */ open class MigrateEssentialFiles @@ -139,7 +139,7 @@ internal constructor( /** * Copies [file] to [destinationDirectory], retaining the same filename */ - fun copyTopLevelFile(file: File, destinationDirectory: Directory) { + private fun copyTopLevelFile(file: File, destinationDirectory: Directory) { val destinationPath = File(destinationDirectory.directory, file.name).path Timber.i("Migrating essential file: '${file.name}'") Timber.d("Copying '$file' to '$destinationPath'") diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MigrateUserData.kt b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MigrateUserData.kt index 31ec18d2a146..d9e34a48ce33 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MigrateUserData.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MigrateUserData.kt @@ -413,7 +413,7 @@ open class MigrateUserData protected constructor(val source: Directory, val dest var terminatedWith: Exception? = null private set - val retriedDirectories = hashSetOf() + private val retriedDirectories = hashSetOf() val loggedExceptions = mutableListOf() private var consecutiveExceptionsWithoutProgress = 0 @@ -589,7 +589,7 @@ open class MigrateUserData protected constructor(val source: Directory, val dest /** Returns a sequence of the Files or Directories in [source] which are to be migrated */ private fun getUserDataFiles() = getDirectoryContent().filter { isUserData(it) } - fun isEssentialFileName(name: String): Boolean { + private fun isEssentialFileName(name: String): Boolean { return MigrateEssentialFiles.PRIORITY_FILES.flatMap { it.potentialFileNames }.contains(name) } diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MoveDirectory.kt b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MoveDirectory.kt similarity index 97% rename from AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MoveDirectory.kt rename to AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MoveDirectory.kt index 8f674c33710b..95bea204b7be 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/MoveDirectory.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/scopedstorage/migrateuserdata/MoveDirectory.kt @@ -50,7 +50,7 @@ data class MoveDirectory(val source: Directory, val destination: File) : Operati * Create an empty directory at destination. * Return whether it was successful. */ - internal fun createDirectory(context: MigrationContext): Boolean { + private fun createDirectory(context: MigrationContext): Boolean { Timber.d("creating directory '$destination'") createDirectory(destination)