mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 02:39:55 +01:00
Update jumbomoji processing and downloading.
This commit is contained in:
@@ -93,9 +93,10 @@ public class ApplicationMigrations {
|
||||
//static final int CHANGE_NUMBER_CAPABILITY_3 = 49;
|
||||
static final int PNI = 50;
|
||||
static final int FIX_DEPRECATION = 51; // Only used to trigger clearing the 'client deprecated' flag
|
||||
static final int JUMBOMOJI_DOWNLOAD = 52;
|
||||
}
|
||||
|
||||
public static final int CURRENT_VERSION = 51;
|
||||
public static final int CURRENT_VERSION = 52;
|
||||
|
||||
/**
|
||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||
@@ -401,6 +402,10 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.PNI, new PniMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.JUMBOMOJI_DOWNLOAD) {
|
||||
jobs.put(Version.JUMBOMOJI_DOWNLOAD, new EmojiDownloadMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
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.DownloadLatestEmojiDataJob;
|
||||
|
||||
/**
|
||||
* Schedules a emoji download job to get the latest version.
|
||||
*/
|
||||
public final class EmojiDownloadMigrationJob extends MigrationJob {
|
||||
|
||||
public static final String KEY = "EmojiDownloadMigrationJob";
|
||||
|
||||
EmojiDownloadMigrationJob() {
|
||||
this(new Parameters.Builder().build());
|
||||
}
|
||||
|
||||
private EmojiDownloadMigrationJob(@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(new DownloadLatestEmojiDataJob(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean shouldRetry(@NonNull Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class Factory implements Job.Factory<EmojiDownloadMigrationJob> {
|
||||
@Override
|
||||
public @NonNull EmojiDownloadMigrationJob create(@NonNull Parameters parameters, @NonNull Data data) {
|
||||
return new EmojiDownloadMigrationJob(parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user