fix: snapshot state errors when patching

This commit is contained in:
Canny 2022-12-05 21:40:20 +03:00
parent d70e750c36
commit 815a33d471
No known key found for this signature in database
GPG Key ID: 395CCB0AA979F27B

View File

@ -86,7 +86,6 @@ class PatchingScreenViewModel(
}
init {
status = Status.Patching
app.registerReceiver(
installBroadcastReceiver,
IntentFilter().apply {
@ -111,6 +110,9 @@ class PatchingScreenViewModel(
}
private val patcher = viewModelScope.launch(Dispatchers.IO) {
withContext(Dispatchers.Main) {
status = Status.Patching
}
val workdir = createWorkDir()
val wakeLock: PowerManager.WakeLock =
(app.getSystemService(Context.POWER_SERVICE) as PowerManager).run {