Show immediate progress feedback when creating a local backup.

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
Alex Hart
2026-02-27 13:36:13 -04:00
committed by Greyson Parrelli
parent db4c11cd53
commit 20d16a8433
2 changed files with 15 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ class DefaultLocalBackupsSettingsCallback(
override fun onCreateBackupClick() {
if (BackupUtil.isUserSelectionRequired(fragment.requireContext())) {
Log.i(TAG, "Queueing backup...")
viewModel.onBackupStarted()
enqueueArchive(false)
} else {
Permissions.with(fragment)
@@ -105,6 +106,7 @@ class DefaultLocalBackupsSettingsCallback(
.ifNecessary()
.onAllGranted {
Log.i(TAG, "Queuing backup...")
viewModel.onBackupStarted()
enqueueArchive(false)
}
.withPermanentDenialDialog(

View File

@@ -116,6 +116,19 @@ class LocalBackupsViewModel : ViewModel(), BackupKeyCredentialManagerHandler {
}
}
fun onBackupStarted() {
val context = AppDependencies.application
internalSettingsState.update {
it.copy(
progress = BackupProgressState.InProgress(
summary = context.getString(R.string.BackupsPreferenceFragment__in_progress),
percentLabel = context.getString(R.string.BackupsPreferenceFragment__d_so_far, 0),
progressFraction = null
)
)
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onBackupEvent(event: LocalBackupV2Event) {
val context = AppDependencies.application