Search in sources :

Example 1 with MultiDeviceStorageSyncRequestJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob in project Signal-Android by WhisperSystems.

the class StorageCapabilityMigrationJob method performMigration.

@Override
public void performMigration() {
    JobManager jobManager = ApplicationDependencies.getJobManager();
    jobManager.add(new RefreshAttributesJob());
    if (TextSecurePreferences.isMultiDevice(context)) {
        Log.i(TAG, "Multi-device.");
        jobManager.startChain(new StorageForcePushJob()).then(new MultiDeviceKeysUpdateJob()).then(new MultiDeviceStorageSyncRequestJob()).enqueue();
    } else {
        Log.i(TAG, "Single-device.");
        jobManager.add(new StorageForcePushJob());
    }
}
Also used : StorageForcePushJob(org.thoughtcrime.securesms.jobs.StorageForcePushJob) RefreshAttributesJob(org.thoughtcrime.securesms.jobs.RefreshAttributesJob) MultiDeviceStorageSyncRequestJob(org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob) MultiDeviceKeysUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Example 2 with MultiDeviceStorageSyncRequestJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob in project Signal-Android by signalapp.

the class StorageCapabilityMigrationJob method performMigration.

@Override
public void performMigration() {
    JobManager jobManager = ApplicationDependencies.getJobManager();
    jobManager.add(new RefreshAttributesJob());
    if (TextSecurePreferences.isMultiDevice(context)) {
        Log.i(TAG, "Multi-device.");
        jobManager.startChain(new StorageForcePushJob()).then(new MultiDeviceKeysUpdateJob()).then(new MultiDeviceStorageSyncRequestJob()).enqueue();
    } else {
        Log.i(TAG, "Single-device.");
        jobManager.add(new StorageForcePushJob());
    }
}
Also used : StorageForcePushJob(org.thoughtcrime.securesms.jobs.StorageForcePushJob) RefreshAttributesJob(org.thoughtcrime.securesms.jobs.RefreshAttributesJob) MultiDeviceStorageSyncRequestJob(org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob) MultiDeviceKeysUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Aggregations

JobManager (org.thoughtcrime.securesms.jobmanager.JobManager)2 MultiDeviceKeysUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob)2 MultiDeviceStorageSyncRequestJob (org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob)2 RefreshAttributesJob (org.thoughtcrime.securesms.jobs.RefreshAttributesJob)2 StorageForcePushJob (org.thoughtcrime.securesms.jobs.StorageForcePushJob)2