@@ -21,6 +21,7 @@ import com.github.capntrips.kernelflasher.common.types.partitions.Partitions
2121import com.topjohnwu.superuser.Shell
2222import com.topjohnwu.superuser.nio.ExtendedFile
2323import com.topjohnwu.superuser.nio.FileSystemManager
24+ import kotlin.DeprecationLevel
2425import kotlinx.coroutines.Dispatchers
2526import kotlinx.coroutines.launch
2627import kotlinx.coroutines.withContext
@@ -60,7 +61,7 @@ class BackupsViewModel(
6061 var wasRestored: Boolean? = null
6162 private val _backupPartitions : SnapshotStateMap <String , Boolean > = mutableStateMapOf()
6263 private val hashAlgorithm: String = " SHA-256"
63- @Deprecated(" Backup migration will be removed in the first stable release" )
64+ @Deprecated(" Backup migration will be removed in the first stable release" , level = DeprecationLevel . WARNING )
6465 private var _needsMigration : MutableState <Boolean > = mutableStateOf(false )
6566
6667 val restoreOutput: List <String >
@@ -82,8 +83,8 @@ class BackupsViewModel(
8283 fun refresh (context : Context ) {
8384 val oldDir = context.getExternalFilesDir(null )
8485 val oldBackupsDir = File (oldDir, " backups" )
85- @Deprecated(" Backup migration will be removed in the first stable release" )
86- _needsMigration .value = oldBackupsDir.exists() && oldBackupsDir.listFiles()?.size !! > 0
86+ @Deprecated(" Backup migration will be removed in the first stable release" , level = DeprecationLevel . WARNING )
87+ _needsMigration .value = oldBackupsDir.exists() && ( oldBackupsDir.listFiles()?.isNotEmpty() == true )
8788 @SuppressLint(" SdCardPath" )
8889 val externalDir = File (" /sdcard/KernelFlasher" )
8990 val backupsDir = fileSystemManager.getFile(" $externalDir /backups" )
0 commit comments