mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-21 19:48:29 +00:00
Rename StorageSyncJobV2 -> StorageSyncJob.
This commit is contained in:
committed by
Alex Hart
parent
38e64b1f75
commit
4461d6cf7f
@@ -32,7 +32,7 @@ import org.thoughtcrime.securesms.database.RecipientDatabase.RegisteredState;
|
|||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
||||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageSyncJobV2;
|
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||||
@@ -194,7 +194,7 @@ public class DirectoryHelper {
|
|||||||
|
|
||||||
if (newRegisteredState != originalRegisteredState) {
|
if (newRegisteredState != originalRegisteredState) {
|
||||||
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob());
|
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob());
|
||||||
ApplicationDependencies.getJobManager().add(new StorageSyncJobV2());
|
ApplicationDependencies.getJobManager().add(new StorageSyncJob());
|
||||||
|
|
||||||
if (notifyOfNewUsers && newRegisteredState == RegisteredState.REGISTERED && recipient.resolve().isSystemContact()) {
|
if (notifyOfNewUsers && newRegisteredState == RegisteredState.REGISTERED && recipient.resolve().isSystemContact()) {
|
||||||
notifyNewUsers(context, Collections.singletonList(recipient.getId()));
|
notifyNewUsers(context, Collections.singletonList(recipient.getId()));
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class DirectoryRefreshJob extends BaseJob {
|
|||||||
boolean notifyOfNewUsers)
|
boolean notifyOfNewUsers)
|
||||||
{
|
{
|
||||||
this(new Job.Parameters.Builder()
|
this(new Job.Parameters.Builder()
|
||||||
.setQueue(StorageSyncJobV2.QUEUE_KEY)
|
.setQueue(StorageSyncJob.QUEUE_KEY)
|
||||||
.addConstraint(NetworkConstraint.KEY)
|
.addConstraint(NetworkConstraint.KEY)
|
||||||
.setMaxAttempts(10)
|
.setMaxAttempts(10)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public final class JobManagerFactories {
|
|||||||
put(StickerDownloadJob.KEY, new StickerDownloadJob.Factory());
|
put(StickerDownloadJob.KEY, new StickerDownloadJob.Factory());
|
||||||
put(StickerPackDownloadJob.KEY, new StickerPackDownloadJob.Factory());
|
put(StickerPackDownloadJob.KEY, new StickerPackDownloadJob.Factory());
|
||||||
put(StorageForcePushJob.KEY, new StorageForcePushJob.Factory());
|
put(StorageForcePushJob.KEY, new StorageForcePushJob.Factory());
|
||||||
put(StorageSyncJobV2.KEY, new StorageSyncJobV2.Factory());
|
put(StorageSyncJob.KEY, new StorageSyncJob.Factory());
|
||||||
put(TrimThreadJob.KEY, new TrimThreadJob.Factory());
|
put(TrimThreadJob.KEY, new TrimThreadJob.Factory());
|
||||||
put(TypingSendJob.KEY, new TypingSendJob.Factory());
|
put(TypingSendJob.KEY, new TypingSendJob.Factory());
|
||||||
put(UpdateApkJob.KEY, new UpdateApkJob.Factory());
|
put(UpdateApkJob.KEY, new UpdateApkJob.Factory());
|
||||||
@@ -189,7 +189,7 @@ public final class JobManagerFactories {
|
|||||||
put("Argon2TestJob", new FailingJob.Factory());
|
put("Argon2TestJob", new FailingJob.Factory());
|
||||||
put("Argon2TestMigrationJob", new PassingMigrationJob.Factory());
|
put("Argon2TestMigrationJob", new PassingMigrationJob.Factory());
|
||||||
put("StorageKeyRotationMigrationJob", new PassingMigrationJob.Factory());
|
put("StorageKeyRotationMigrationJob", new PassingMigrationJob.Factory());
|
||||||
put("StorageSyncJob", new StorageSyncJobV2.Factory());
|
put("StorageSyncJob", new StorageSyncJob.Factory());
|
||||||
put("WakeGroupV2Job", new FailingJob.Factory());
|
put("WakeGroupV2Job", new FailingJob.Factory());
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class StorageAccountRestoreJob extends BaseJob {
|
|||||||
|
|
||||||
public StorageAccountRestoreJob() {
|
public StorageAccountRestoreJob() {
|
||||||
this(new Parameters.Builder()
|
this(new Parameters.Builder()
|
||||||
.setQueue(StorageSyncJobV2.QUEUE_KEY)
|
.setQueue(StorageSyncJob.QUEUE_KEY)
|
||||||
.addConstraint(NetworkConstraint.KEY)
|
.addConstraint(NetworkConstraint.KEY)
|
||||||
.setMaxInstancesForFactory(1)
|
.setMaxInstancesForFactory(1)
|
||||||
.setMaxAttempts(1)
|
.setMaxAttempts(1)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class StorageForcePushJob extends BaseJob {
|
|||||||
|
|
||||||
public StorageForcePushJob() {
|
public StorageForcePushJob() {
|
||||||
this(new Parameters.Builder().addConstraint(NetworkConstraint.KEY)
|
this(new Parameters.Builder().addConstraint(NetworkConstraint.KEY)
|
||||||
.setQueue(StorageSyncJobV2.QUEUE_KEY)
|
.setQueue(StorageSyncJob.QUEUE_KEY)
|
||||||
.setMaxInstancesForFactory(1)
|
.setMaxInstancesForFactory(1)
|
||||||
.setLifespan(TimeUnit.DAYS.toMillis(1))
|
.setLifespan(TimeUnit.DAYS.toMillis(1))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -136,14 +136,14 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* to enqueue a {@link StorageServiceMigrationJob} as an app migration to make sure it gets
|
* to enqueue a {@link StorageServiceMigrationJob} as an app migration to make sure it gets
|
||||||
* synced.
|
* synced.
|
||||||
*/
|
*/
|
||||||
public class StorageSyncJobV2 extends BaseJob {
|
public class StorageSyncJob extends BaseJob {
|
||||||
|
|
||||||
public static final String KEY = "StorageSyncJobV2";
|
public static final String KEY = "StorageSyncJobV2";
|
||||||
public static final String QUEUE_KEY = "StorageSyncingJobs";
|
public static final String QUEUE_KEY = "StorageSyncingJobs";
|
||||||
|
|
||||||
private static final String TAG = Log.tag(StorageSyncJobV2.class);
|
private static final String TAG = Log.tag(StorageSyncJob.class);
|
||||||
|
|
||||||
public StorageSyncJobV2() {
|
public StorageSyncJob() {
|
||||||
this(new Parameters.Builder().addConstraint(NetworkConstraint.KEY)
|
this(new Parameters.Builder().addConstraint(NetworkConstraint.KEY)
|
||||||
.setQueue(QUEUE_KEY)
|
.setQueue(QUEUE_KEY)
|
||||||
.setMaxInstancesForFactory(2)
|
.setMaxInstancesForFactory(2)
|
||||||
@@ -152,7 +152,7 @@ public class StorageSyncJobV2 extends BaseJob {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private StorageSyncJobV2(@NonNull Parameters parameters) {
|
private StorageSyncJob(@NonNull Parameters parameters) {
|
||||||
super(parameters);
|
super(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,10 +506,10 @@ public class StorageSyncJobV2 extends BaseJob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Factory implements Job.Factory<StorageSyncJobV2> {
|
public static final class Factory implements Job.Factory<StorageSyncJob> {
|
||||||
@Override
|
@Override
|
||||||
public @NonNull StorageSyncJobV2 create(@NonNull Parameters parameters, @NonNull Data data) {
|
public @NonNull StorageSyncJob create(@NonNull Parameters parameters, @NonNull Data data) {
|
||||||
return new StorageSyncJobV2(parameters);
|
return new StorageSyncJob(parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ import org.thoughtcrime.securesms.jobmanager.Data;
|
|||||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob;
|
import org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageSyncJobV2;
|
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,12 +44,12 @@ public class StorageServiceMigrationJob extends MigrationJob {
|
|||||||
|
|
||||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||||
Log.i(TAG, "Multi-device.");
|
Log.i(TAG, "Multi-device.");
|
||||||
jobManager.startChain(new StorageSyncJobV2())
|
jobManager.startChain(new StorageSyncJob())
|
||||||
.then(new MultiDeviceKeysUpdateJob())
|
.then(new MultiDeviceKeysUpdateJob())
|
||||||
.enqueue();
|
.enqueue();
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, "Single-device.");
|
Log.i(TAG, "Single-device.");
|
||||||
jobManager.add(new StorageSyncJobV2());
|
jobManager.add(new StorageSyncJob());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.signal.core.util.logging.Log;
|
|||||||
import org.thoughtcrime.securesms.KbsEnclave;
|
import org.thoughtcrime.securesms.KbsEnclave;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageAccountRestoreJob;
|
import org.thoughtcrime.securesms.jobs.StorageAccountRestoreJob;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageSyncJobV2;
|
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||||
import org.thoughtcrime.securesms.registration.service.KeyBackupSystemWrongPinException;
|
import org.thoughtcrime.securesms.registration.service.KeyBackupSystemWrongPinException;
|
||||||
import org.thoughtcrime.securesms.util.Stopwatch;
|
import org.thoughtcrime.securesms.util.Stopwatch;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
@@ -83,7 +83,7 @@ public class PinRestoreRepository {
|
|||||||
ApplicationDependencies.getJobManager().runSynchronously(new StorageAccountRestoreJob(), StorageAccountRestoreJob.LIFESPAN);
|
ApplicationDependencies.getJobManager().runSynchronously(new StorageAccountRestoreJob(), StorageAccountRestoreJob.LIFESPAN);
|
||||||
stopwatch.split("AccountRestore");
|
stopwatch.split("AccountRestore");
|
||||||
|
|
||||||
ApplicationDependencies.getJobManager().runSynchronously(new StorageSyncJobV2(), TimeUnit.SECONDS.toMillis(10));
|
ApplicationDependencies.getJobManager().runSynchronously(new StorageSyncJob(), TimeUnit.SECONDS.toMillis(10));
|
||||||
stopwatch.split("ContactRestore");
|
stopwatch.split("ContactRestore");
|
||||||
|
|
||||||
stopwatch.stop(TAG);
|
stopwatch.stop(TAG);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
|
|||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageSyncJobV2;
|
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
@@ -31,7 +31,7 @@ public final class RegistrationUtil {
|
|||||||
{
|
{
|
||||||
Log.i(TAG, "Marking registration completed.", new Throwable());
|
Log.i(TAG, "Marking registration completed.", new Throwable());
|
||||||
SignalStore.registrationValues().setRegistrationComplete();
|
SignalStore.registrationValues().setRegistrationComplete();
|
||||||
ApplicationDependencies.getJobManager().startChain(new StorageSyncJobV2())
|
ApplicationDependencies.getJobManager().startChain(new StorageSyncJob())
|
||||||
.then(new DirectoryRefreshJob(false))
|
.then(new DirectoryRefreshJob(false))
|
||||||
.enqueue();
|
.enqueue();
|
||||||
} else if (!SignalStore.registrationValues().isRegistrationComplete()) {
|
} else if (!SignalStore.registrationValues().isRegistrationComplete()) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.thoughtcrime.securesms.database.RecipientDatabase;
|
|||||||
import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientSettings;
|
import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientSettings;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileAvatarJob;
|
import org.thoughtcrime.securesms.jobs.RetrieveProfileAvatarJob;
|
||||||
import org.thoughtcrime.securesms.jobs.StorageSyncJobV2;
|
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||||
import org.thoughtcrime.securesms.keyvalue.PhoneNumberPrivacyValues;
|
import org.thoughtcrime.securesms.keyvalue.PhoneNumberPrivacyValues;
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
import org.thoughtcrime.securesms.payments.Entropy;
|
import org.thoughtcrime.securesms.payments.Entropy;
|
||||||
@@ -292,7 +292,7 @@ public final class StorageSyncHelper {
|
|||||||
Log.d(TAG, "Registration still ongoing. Ignore sync request.");
|
Log.d(TAG, "Registration still ongoing. Ignore sync request.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ApplicationDependencies.getJobManager().add(new StorageSyncJobV2());
|
ApplicationDependencies.getJobManager().add(new StorageSyncJob());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void scheduleRoutineSync() {
|
public static void scheduleRoutineSync() {
|
||||||
|
|||||||
Reference in New Issue
Block a user