Skip to content

Commit fc49c31

Browse files
committed
Update Kotlin to 2.1.10: Fix Annotation issue
1 parent 589b25e commit fc49c31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/java/com/github/capntrips/kernelflasher/ui/screens/backups/BackupsViewModel.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.github.capntrips.kernelflasher.common.types.partitions.Partitions
2121
import com.topjohnwu.superuser.Shell
2222
import com.topjohnwu.superuser.nio.ExtendedFile
2323
import com.topjohnwu.superuser.nio.FileSystemManager
24+
import kotlin.DeprecationLevel
2425
import kotlinx.coroutines.Dispatchers
2526
import kotlinx.coroutines.launch
2627
import 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

Comments
 (0)