mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Verify backup can be decrypted as part of creation flow.
This commit is contained in:
@@ -22,10 +22,11 @@ import androidx.fragment.app.Fragment;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.signal.core.util.ThreadUtil;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.backup.BackupDialog;
|
||||
import org.thoughtcrime.securesms.backup.FullBackupBase;
|
||||
import org.thoughtcrime.securesms.backup.BackupEvent;
|
||||
import org.thoughtcrime.securesms.database.NoExternalStorageException;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.LocalBackupJob;
|
||||
@@ -37,6 +38,7 @@ import org.thoughtcrime.securesms.util.StorageUtil;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class BackupsPreferenceFragment extends Fragment {
|
||||
|
||||
@@ -120,10 +122,11 @@ public class BackupsPreferenceFragment extends Fragment {
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(FullBackupBase.BackupEvent event) {
|
||||
if (event.getType() == FullBackupBase.BackupEvent.Type.PROGRESS) {
|
||||
public void onEvent(BackupEvent event) {
|
||||
if (event.getType() == BackupEvent.Type.PROGRESS || event.getType() == BackupEvent.Type.PROGRESS_VERIFYING) {
|
||||
create.setEnabled(false);
|
||||
summary.setText(getString(R.string.BackupsPreferenceFragment__in_progress));
|
||||
summary.setText(getString(event.getType() == BackupEvent.Type.PROGRESS ? R.string.BackupsPreferenceFragment__in_progress
|
||||
: R.string.BackupsPreferenceFragment__verifying_backup));
|
||||
progress.setVisibility(View.VISIBLE);
|
||||
progressSummary.setVisibility(event.getCount() > 0 ? View.VISIBLE : View.GONE);
|
||||
|
||||
@@ -138,11 +141,12 @@ public class BackupsPreferenceFragment extends Fragment {
|
||||
progress.setProgress((int) completionPercentage);
|
||||
progressSummary.setText(getString(R.string.BackupsPreferenceFragment__s_so_far, formatter.format(completionPercentage)));
|
||||
}
|
||||
} else if (event.getType() == FullBackupBase.BackupEvent.Type.FINISHED) {
|
||||
} else if (event.getType() == BackupEvent.Type.FINISHED) {
|
||||
create.setEnabled(true);
|
||||
progress.setVisibility(View.GONE);
|
||||
progressSummary.setVisibility(View.GONE);
|
||||
setBackupSummary();
|
||||
ThreadUtil.runOnMainDelayed(this::setBackupSummary, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user