Remove versioned profiles feature flag.

This commit is contained in:
Alan Evans
2020-07-07 12:00:29 -03:00
committed by Greyson Parrelli
parent 99ff0c1e3c
commit 96e888a4f5
12 changed files with 76 additions and 136 deletions

View File

@@ -39,7 +39,7 @@ public class ApplicationMigrations {
private static final int LEGACY_CANONICAL_VERSION = 455;
public static final int CURRENT_VERSION = 15;
public static final int CURRENT_VERSION = 16;
private static final class Version {
static final int LEGACY = 1;
@@ -53,10 +53,11 @@ public class ApplicationMigrations {
//static final int TEST_ARGON2 = 9;
static final int SWOON_STICKERS = 10;
static final int STORAGE_SERVICE = 11;
static final int STORAGE_KEY_ROTATE = 12;
//static final int STORAGE_KEY_ROTATE = 12;
static final int REMOVE_AVATAR_ID = 13;
static final int STORAGE_CAPABILITY = 14;
static final int PIN_REMINDER = 15;
static final int VERSIONED_PROFILE = 16;
}
/**
@@ -231,6 +232,10 @@ public class ApplicationMigrations {
jobs.put(Version.PIN_REMINDER, new PinReminderMigrationJob());
}
if (lastSeenVersion < Version.VERSIONED_PROFILE) {
jobs.put(Version.VERSIONED_PROFILE, new ProfileMigrationJob());
}
return jobs;
}

View File

@@ -0,0 +1,55 @@
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.ProfileUploadJob;
import org.thoughtcrime.securesms.logging.Log;
/**
* Schedules a re-upload of the users profile.
*/
public final class ProfileMigrationJob extends MigrationJob {
private static final String TAG = Log.tag(ProfileMigrationJob.class);
public static final String KEY = "ProfileMigrationJob";
ProfileMigrationJob() {
this(new Parameters.Builder().build());
}
private ProfileMigrationJob(@NonNull Parameters parameters) {
super(parameters);
}
@Override
public boolean isUiBlocking() {
return false;
}
@Override
public @NonNull String getFactoryKey() {
return KEY;
}
@Override
public void performMigration() {
Log.i(TAG, "Scheduling profile upload job");
ApplicationDependencies.getJobManager().add(new ProfileUploadJob());
}
@Override
boolean shouldRetry(@NonNull Exception e) {
return false;
}
public static class Factory implements Job.Factory<ProfileMigrationJob> {
@Override
public @NonNull ProfileMigrationJob create(@NonNull Parameters parameters, @NonNull Data data) {
return new ProfileMigrationJob(parameters);
}
}
}