mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 10:51:27 +01:00
Migrate linked device status to the SignalStore.
This commit is contained in:
@@ -12,6 +12,7 @@ import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob;
|
||||
import org.thoughtcrime.securesms.jobs.StickerPackDownloadJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.stickers.BlessedPacks;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
@@ -58,7 +59,7 @@ public class StickerLaunchMigrationJob extends MigrationJob {
|
||||
|
||||
jobManager.add(StickerPackDownloadJob.forInstall(pack.getPackId(), pack.getPackKey(), false));
|
||||
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
if (SignalStore.account().hasLinkedDevices()) {
|
||||
jobManager.add(new MultiDeviceStickerPackOperationJob(pack.getPackId(), pack.getPackKey(), MultiDeviceStickerPackOperationJob.Type.INSTALL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshOwnProfileJob;
|
||||
import org.thoughtcrime.securesms.jobs.StorageForcePushJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,7 @@ public class StorageCapabilityMigrationJob extends MigrationJob {
|
||||
|
||||
jobManager.startChain(new RefreshAttributesJob()).then(new RefreshOwnProfileJob()).enqueue();
|
||||
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
if (SignalStore.account().hasLinkedDevices()) {
|
||||
Log.i(TAG, "Multi-device.");
|
||||
jobManager.startChain(new StorageForcePushJob())
|
||||
.then(new MultiDeviceKeysUpdateJob())
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.thoughtcrime.securesms.jobmanager.Job
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob
|
||||
import org.thoughtcrime.securesms.jobs.StorageSyncJob
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
|
||||
/**
|
||||
* Remove local unknown storage ids not in local storage service manifest.
|
||||
@@ -44,7 +43,7 @@ internal class StorageFixLocalUnknownMigrationJob(
|
||||
|
||||
val jobManager = AppDependencies.jobManager
|
||||
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
if (SignalStore.account.hasLinkedDevices) {
|
||||
Log.i(TAG, "Multi-device.")
|
||||
jobManager.startChain(StorageSyncJob())
|
||||
.then(MultiDeviceKeysUpdateJob())
|
||||
|
||||
@@ -52,7 +52,7 @@ public class StorageServiceMigrationJob extends MigrationJob {
|
||||
|
||||
JobManager jobManager = AppDependencies.getJobManager();
|
||||
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
if (SignalStore.account().hasLinkedDevices()) {
|
||||
Log.i(TAG, "Multi-device.");
|
||||
jobManager.startChain(new StorageSyncJob())
|
||||
.then(new MultiDeviceKeysUpdateJob())
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.thoughtcrime.securesms.migrations
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.jobmanager.Job
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
|
||||
/**
|
||||
* Migration to sync keys with linked devices.
|
||||
@@ -21,7 +21,7 @@ internal class SyncKeysMigrationJob(
|
||||
override fun isUiBlocking(): Boolean = false
|
||||
|
||||
override fun performMigration() {
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
if (SignalStore.account.hasLinkedDevices) {
|
||||
AppDependencies.jobManager.add(MultiDeviceKeysUpdateJob())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user