mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Introduce AEP and SSRE2.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package org.thoughtcrime.securesms.migrations
|
||||
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.jobmanager.Job
|
||||
import org.thoughtcrime.securesms.jobs.StorageForcePushJob
|
||||
import org.thoughtcrime.securesms.jobs.Svr2MirrorJob
|
||||
|
||||
/**
|
||||
* Migration for when we introduce the Account Entropy Pool (AEP).
|
||||
*/
|
||||
internal class AepMigrationJob(
|
||||
parameters: Parameters = Parameters.Builder().build()
|
||||
) : MigrationJob(parameters) {
|
||||
|
||||
companion object {
|
||||
val TAG = Log.tag(AepMigrationJob::class.java)
|
||||
const val KEY = "AepMigrationJob"
|
||||
}
|
||||
|
||||
override fun getFactoryKey(): String = KEY
|
||||
|
||||
override fun isUiBlocking(): Boolean = false
|
||||
|
||||
override fun performMigration() {
|
||||
AppDependencies.jobManager.add(Svr2MirrorJob())
|
||||
AppDependencies.jobManager.add(StorageForcePushJob())
|
||||
}
|
||||
|
||||
override fun shouldRetry(e: Exception): Boolean = false
|
||||
|
||||
class Factory : Job.Factory<AepMigrationJob> {
|
||||
override fun create(parameters: Parameters, serializedData: ByteArray?): AepMigrationJob {
|
||||
return AepMigrationJob(parameters)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,9 +160,10 @@ public class ApplicationMigrations {
|
||||
static final int BACKFILL_DIGESTS_V3 = 116;
|
||||
static final int SVR2_ENCLAVE_UPDATE_2 = 117;
|
||||
static final int WALLPAPER_MIGRATION_CLEANUP = 118;
|
||||
static final int AEP_INTRODUCTION = 119;
|
||||
}
|
||||
|
||||
public static final int CURRENT_VERSION = 118;
|
||||
public static final int CURRENT_VERSION = 119;
|
||||
|
||||
/**
|
||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||
@@ -733,6 +734,10 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.WALLPAPER_MIGRATION_CLEANUP, new WallpaperCleanupMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.AEP_INTRODUCTION) {
|
||||
jobs.put(Version.AEP_INTRODUCTION, new AepMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user