mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-06 21:35:46 +01:00
Fix PictureInPictureUiState not found crashes.
This commit is contained in:
@@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user