Enable Change Number.
This commit is contained in:
parent
8cb4cc5ac3
commit
d48632d09d
4 changed files with 10 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
package org.thoughtcrime.securesms;
|
package org.thoughtcrime.securesms;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
|
||||||
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
||||||
|
|
||||||
public final class AppCapabilities {
|
public final class AppCapabilities {
|
||||||
|
@ -13,12 +12,13 @@ public final class AppCapabilities {
|
||||||
private static final boolean GV1_MIGRATION = true;
|
private static final boolean GV1_MIGRATION = true;
|
||||||
private static final boolean ANNOUNCEMENT_GROUPS = true;
|
private static final boolean ANNOUNCEMENT_GROUPS = true;
|
||||||
private static final boolean SENDER_KEY = true;
|
private static final boolean SENDER_KEY = true;
|
||||||
|
private static final boolean CHANGE_NUMBER = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param storageCapable Whether or not the user can use storage service. This is another way of
|
* @param storageCapable Whether or not the user can use storage service. This is another way of
|
||||||
* asking if the user has set a Signal PIN or not.
|
* asking if the user has set a Signal PIN or not.
|
||||||
*/
|
*/
|
||||||
public static AccountAttributes.Capabilities getCapabilities(boolean storageCapable) {
|
public static AccountAttributes.Capabilities getCapabilities(boolean storageCapable) {
|
||||||
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, FeatureFlags.changeNumber());
|
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, CHANGE_NUMBER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.thoughtcrime.securesms.lock.v2.KbsConstants
|
||||||
import org.thoughtcrime.securesms.lock.v2.PinKeyboardType
|
import org.thoughtcrime.securesms.lock.v2.PinKeyboardType
|
||||||
import org.thoughtcrime.securesms.pin.RegistrationLockV2Dialog
|
import org.thoughtcrime.securesms.pin.RegistrationLockV2Dialog
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient
|
import org.thoughtcrime.securesms.recipients.Recipient
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
|
||||||
import org.thoughtcrime.securesms.util.ServiceUtil
|
import org.thoughtcrime.securesms.util.ServiceUtil
|
||||||
import org.thoughtcrime.securesms.util.ThemeUtil
|
import org.thoughtcrime.securesms.util.ThemeUtil
|
||||||
|
|
||||||
|
@ -106,7 +105,7 @@ class AccountSettingsFragment : DSLSettingsFragment(R.string.AccountSettingsFrag
|
||||||
|
|
||||||
sectionHeaderPref(R.string.AccountSettingsFragment__account)
|
sectionHeaderPref(R.string.AccountSettingsFragment__account)
|
||||||
|
|
||||||
if (FeatureFlags.changeNumber() && Recipient.self().changeNumberCapability == Recipient.Capability.SUPPORTED) {
|
if (Recipient.self().changeNumberCapability == Recipient.Capability.SUPPORTED) {
|
||||||
clickPref(
|
clickPref(
|
||||||
title = DSLSettingsText.from(R.string.AccountSettingsFragment__change_phone_number),
|
title = DSLSettingsText.from(R.string.AccountSettingsFragment__change_phone_number),
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|
|
@ -90,9 +90,10 @@ public class ApplicationMigrations {
|
||||||
static final int CHANGE_NUMBER_CAPABILITY_2 = 46;
|
static final int CHANGE_NUMBER_CAPABILITY_2 = 46;
|
||||||
static final int DEFAULT_REACTIONS_SYNC = 47;
|
static final int DEFAULT_REACTIONS_SYNC = 47;
|
||||||
static final int DB_REACTIONS_MIGRATION = 48;
|
static final int DB_REACTIONS_MIGRATION = 48;
|
||||||
|
static final int CHANGE_NUMBER_CAPABILITY_3 = 49;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int CURRENT_VERSION = 48;
|
public static final int CURRENT_VERSION = 49;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||||
|
@ -394,6 +395,10 @@ public class ApplicationMigrations {
|
||||||
jobs.put(Version.DB_REACTIONS_MIGRATION, new DatabaseMigrationJob());
|
jobs.put(Version.DB_REACTIONS_MIGRATION, new DatabaseMigrationJob());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastSeenVersion < Version.CHANGE_NUMBER_CAPABILITY_3) {
|
||||||
|
jobs.put(Version.CHANGE_NUMBER_CAPABILITY_3, new AttributesMigrationJob());
|
||||||
|
}
|
||||||
|
|
||||||
return jobs;
|
return jobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,6 @@ public final class FeatureFlags {
|
||||||
private static final String SUGGEST_SMS_BLACKLIST = "android.suggestSmsBlacklist";
|
private static final String SUGGEST_SMS_BLACKLIST = "android.suggestSmsBlacklist";
|
||||||
private static final String MAX_GROUP_CALL_RING_SIZE = "global.calling.maxGroupCallRingSize";
|
private static final String MAX_GROUP_CALL_RING_SIZE = "global.calling.maxGroupCallRingSize";
|
||||||
private static final String GROUP_CALL_RINGING = "android.calling.groupCallRinging";
|
private static final String GROUP_CALL_RINGING = "android.calling.groupCallRinging";
|
||||||
private static final String CHANGE_NUMBER_ENABLED = "android.changeNumber";
|
|
||||||
private static final String DONOR_BADGES = "android.donorBadges.6";
|
private static final String DONOR_BADGES = "android.donorBadges.6";
|
||||||
private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.4";
|
private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.4";
|
||||||
private static final String CDSH = "android.cdsh";
|
private static final String CDSH = "android.cdsh";
|
||||||
|
@ -131,8 +130,7 @@ public final class FeatureFlags {
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(
|
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(
|
||||||
PHONE_NUMBER_PRIVACY_VERSION,
|
PHONE_NUMBER_PRIVACY_VERSION
|
||||||
CHANGE_NUMBER_ENABLED
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -399,11 +397,6 @@ public final class FeatureFlags {
|
||||||
return getBoolean(GROUP_CALL_RINGING, false);
|
return getBoolean(GROUP_CALL_RINGING, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Whether or not to show change number in the UI. */
|
|
||||||
public static boolean changeNumber() {
|
|
||||||
return getBoolean(CHANGE_NUMBER_ENABLED, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not to show donor badges in the UI.
|
* Whether or not to show donor badges in the UI.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue