Fix PictureInPictureUiState not found crashes.

This commit is contained in:
Cody Henthorne
2026-05-08 15:35:40 -04:00
parent a6816df0e8
commit 6baebfe140
3 changed files with 38 additions and 19 deletions
@@ -75,6 +75,8 @@ class QuickstartRestoreActivity : BaseActivity() {
private var restoreStatus by mutableStateOf("Restoring data...")
private val eventBusSubscriber = EventBusSubscriber()
private val manageStorageLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
if (hasStorageAccess()) {
startRestore()
@@ -110,7 +112,7 @@ class QuickstartRestoreActivity : BaseActivity() {
}
}
org.greenrobot.eventbus.EventBus.getDefault().registerForLifecycle(subscriber = this, lifecycleOwner = this)
org.greenrobot.eventbus.EventBus.getDefault().registerForLifecycle(subscriber = eventBusSubscriber, lifecycleOwner = this)
if (hasStorageAccess()) {
startRestore()
@@ -195,8 +197,10 @@ class QuickstartRestoreActivity : BaseActivity() {
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEvent(restoreEvent: RestoreV2Event) {
restoreStatus = "${restoreEvent.type}: ${restoreEvent.count} / ${restoreEvent.estimatedTotalCount}"
private inner class EventBusSubscriber {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEvent(restoreEvent: RestoreV2Event) {
restoreStatus = "${restoreEvent.type}: ${restoreEvent.count} / ${restoreEvent.estimatedTotalCount}"
}
}
}