kopia lustrzana https://github.com/ryukoposting/Signal-Android
Revert "Enable Change Number."
This reverts commit 97642f555e8a1cb89c7bae209b218a1c63532ada.fork-5.53.8
rodzic
88aa67b847
commit
0fa3b2f8f9
|
@ -1,5 +1,6 @@
|
||||||
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 {
|
||||||
|
@ -12,13 +13,12 @@ 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, CHANGE_NUMBER);
|
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, FeatureFlags.changeNumber());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ 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
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ class AccountSettingsFragment : DSLSettingsFragment(R.string.AccountSettingsFrag
|
||||||
|
|
||||||
sectionHeaderPref(R.string.AccountSettingsFragment__account)
|
sectionHeaderPref(R.string.AccountSettingsFragment__account)
|
||||||
|
|
||||||
if (Recipient.self().changeNumberCapability == Recipient.Capability.SUPPORTED) {
|
if (FeatureFlags.changeNumber() && 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,7 +90,7 @@ 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;
|
//static final int CHANGE_NUMBER_CAPABILITY_3 = 49;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int CURRENT_VERSION = 49;
|
public static final int CURRENT_VERSION = 49;
|
||||||
|
@ -395,10 +395,6 @@ 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,6 +83,7 @@ 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";
|
||||||
|
@ -130,7 +131,8 @@ 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
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -397,6 +399,11 @@ 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.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
package org.thoughtcrime.securesms.migrations
|
|
||||||
|
|
||||||
import org.junit.Assert.assertEquals
|
|
||||||
import org.junit.Test
|
|
||||||
import java.lang.reflect.Field
|
|
||||||
import java.lang.reflect.Modifier
|
|
||||||
|
|
||||||
class ApplicationMigrationsTest {
|
|
||||||
@Test
|
|
||||||
fun `ensure ApplicationMigration CURRENT_VERSION matches max version`() {
|
|
||||||
val fields: Array<Field> = ApplicationMigrations.Version::class.java.declaredFields
|
|
||||||
|
|
||||||
val maxField: Int? = fields.filter { Modifier.isStatic(it.modifiers) && it.type == Int::class.java }
|
|
||||||
.map { it.getInt(null) }
|
|
||||||
.maxOrNull()
|
|
||||||
|
|
||||||
assertEquals(ApplicationMigrations.CURRENT_VERSION, maxField)
|
|
||||||
}
|
|
||||||
}
|
|
Ładowanie…
Reference in New Issue