mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 19:00:26 +01:00
Install a new animated sticker pack.
This commit is contained in:
@@ -40,7 +40,7 @@ public class ApplicationMigrations {
|
||||
|
||||
private static final int LEGACY_CANONICAL_VERSION = 455;
|
||||
|
||||
public static final int CURRENT_VERSION = 25;
|
||||
public static final int CURRENT_VERSION = 26;
|
||||
|
||||
private static final class Version {
|
||||
static final int LEGACY = 1;
|
||||
@@ -68,6 +68,7 @@ public class ApplicationMigrations {
|
||||
static final int BACKUP_NOTIFICATION = 23;
|
||||
static final int GV1_MIGRATION = 24;
|
||||
static final int USER_NOTIFICATION = 25;
|
||||
static final int DAY_BY_DAY_STICKERS = 26;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,6 +287,10 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.USER_NOTIFICATION, new UserNotificationMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.DAY_BY_DAY_STICKERS) {
|
||||
jobs.put(Version.DAY_BY_DAY_STICKERS, new StickerDayByDayMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.thoughtcrime.securesms.migrations;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
import org.thoughtcrime.securesms.jobs.StickerPackDownloadJob;
|
||||
import org.thoughtcrime.securesms.stickers.BlessedPacks;
|
||||
|
||||
/**
|
||||
* Installs Day by Day blessed pack.
|
||||
*/
|
||||
public class StickerDayByDayMigrationJob extends MigrationJob {
|
||||
|
||||
public static final String KEY = "StickerDayByDayMigrationJob";
|
||||
|
||||
StickerDayByDayMigrationJob() {
|
||||
this(new Parameters.Builder().build());
|
||||
}
|
||||
|
||||
private StickerDayByDayMigrationJob(@NonNull Parameters parameters) {
|
||||
super(parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUiBlocking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getFactoryKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performMigration() {
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.DAY_BY_DAY.getPackId(), BlessedPacks.DAY_BY_DAY.getPackKey(), false));
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean shouldRetry(@NonNull Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class Factory implements Job.Factory<StickerDayByDayMigrationJob> {
|
||||
@Override
|
||||
public @NonNull StickerDayByDayMigrationJob create(@NonNull Parameters parameters, @NonNull Data data) {
|
||||
return new StickerDayByDayMigrationJob(parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user