mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Delay directory refresh until registration is complete.
This commit is contained in:
@@ -2,7 +2,6 @@ package org.thoughtcrime.securesms.pin;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -19,7 +18,6 @@ import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.autofill.HintConstants;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
@@ -239,7 +237,7 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
profile.putExtra("next_intent", main);
|
||||
startActivity(profile);
|
||||
} else {
|
||||
RegistrationUtil.markRegistrationPossiblyComplete(requireContext());
|
||||
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
|
||||
ApplicationDependencies.getJobManager().add(new ProfileUploadJob());
|
||||
startActivity(new Intent(activity, MainActivity.class));
|
||||
}
|
||||
@@ -288,12 +286,4 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
button.setClickable(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getDevice() {
|
||||
return String.format("%s %s (%s)", Build.MANUFACTURER, Build.MODEL, Build.PRODUCT);
|
||||
}
|
||||
|
||||
private static String getAndroidVersion() {
|
||||
return String.format("%s (%s, %s)", Build.VERSION.RELEASE, Build.VERSION.INCREMENTAL, Build.DISPLAY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.StorageAccountRestoreJob;
|
||||
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.registration.service.KeyBackupSystemWrongPinException;
|
||||
@@ -18,6 +19,7 @@ import org.whispersystems.signalservice.internal.contacts.entities.TokenResponse
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
class PinRestoreRepository {
|
||||
|
||||
@@ -51,6 +53,9 @@ class PinRestoreRepository {
|
||||
ApplicationDependencies.getJobManager().runSynchronously(new StorageAccountRestoreJob(), StorageAccountRestoreJob.LIFESPAN);
|
||||
stopwatch.split("AccountRestore");
|
||||
|
||||
ApplicationDependencies.getJobManager().runSynchronously(new StorageSyncJob(), TimeUnit.SECONDS.toMillis(10));
|
||||
stopwatch.split("ContactRestore");
|
||||
|
||||
stopwatch.stop(TAG);
|
||||
|
||||
callback.onComplete(new PinResultData(PinResult.SUCCESS, tokenData));
|
||||
|
||||
Reference in New Issue
Block a user