mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Rename FeatureFlags -> RemoteConfig.
This commit is contained in:
@@ -310,7 +310,7 @@ public class CommunicationActions {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FeatureFlags.adHocCalling()) {
|
||||
if (!RemoteConfig.adHocCalling()) {
|
||||
Toast.makeText(activity, R.string.CommunicationActions_cant_join_call, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ public class CommunicationActions {
|
||||
}
|
||||
|
||||
private static void startVideoCall(@NonNull CallContext callContext, @NonNull CallLinkRootKey rootKey) {
|
||||
if (!FeatureFlags.adHocCalling()) {
|
||||
if (!RemoteConfig.adHocCalling()) {
|
||||
Toast.makeText(callContext.getContext(), R.string.CommunicationActions_cant_join_call, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ object DeleteDialog {
|
||||
}
|
||||
}
|
||||
|
||||
if (FeatureFlags.deleteSyncEnabled) {
|
||||
if (RemoteConfig.deleteSyncEnabled) {
|
||||
MultiDeviceDeleteSendSyncJob.enqueueMessageDeletes(messageRecords)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ public final class DeviceProperties {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (memoryMb < FeatureFlags.animatedStickerMinimumTotalMemoryMb()) {
|
||||
if (memoryMb < RemoteConfig.animatedStickerMinimumTotalMemoryMb()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getMemoryClass(context) < FeatureFlags.animatedStickerMinimumMemoryClass()) {
|
||||
if (getMemoryClass(context) < RemoteConfig.animatedStickerMinimumMemoryClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,19 @@ import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Provide access to locale specific values within feature flags following the locale CSV-Colon format.
|
||||
* Provide access to locale-specific values within remote config, following the locale CSV-Colon format.
|
||||
*
|
||||
* Example: countryCode:integerValue,countryCode:integerValue,*:integerValue
|
||||
*/
|
||||
public final class LocaleFeatureFlags {
|
||||
public final class LocaleRemoteConfig {
|
||||
|
||||
private static final String TAG = Log.tag(LocaleFeatureFlags.class);
|
||||
private static final String TAG = Log.tag(LocaleRemoteConfig.class);
|
||||
|
||||
private static final String COUNTRY_WILDCARD = "*";
|
||||
private static final int NOT_FOUND = -1;
|
||||
|
||||
public static @NonNull Optional<PushMediaConstraints.MediaConfig> getMediaQualityLevel() {
|
||||
Map<String, Integer> countryValues = parseCountryValues(FeatureFlags.getMediaQualityLevels(), NOT_FOUND);
|
||||
Map<String, Integer> countryValues = parseCountryValues(RemoteConfig.getMediaQualityLevels(), NOT_FOUND);
|
||||
int level = getCountryValue(countryValues, Recipient.self().getE164().orElse(""), NOT_FOUND);
|
||||
|
||||
return Optional.ofNullable(PushMediaConstraints.MediaConfig.forLevel(level));
|
||||
@@ -44,37 +44,37 @@ public final class LocaleFeatureFlags {
|
||||
* @return Whether Google Pay is disabled in this region
|
||||
*/
|
||||
public static boolean isGooglePayDisabled() {
|
||||
return isEnabledE164Start(FeatureFlags.googlePayDisabledRegions());
|
||||
return isEnabledE164Start(RemoteConfig.googlePayDisabledRegions());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether credit cards are disabled in this region
|
||||
*/
|
||||
public static boolean isCreditCardDisabled() {
|
||||
return isEnabledE164Start(FeatureFlags.creditCardDisabledRegions());
|
||||
return isEnabledE164Start(RemoteConfig.creditCardDisabledRegions());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether PayPal is disabled in this region
|
||||
*/
|
||||
public static boolean isPayPalDisabled() {
|
||||
return isEnabledE164Start(FeatureFlags.paypalDisabledRegions());
|
||||
return isEnabledE164Start(RemoteConfig.paypalDisabledRegions());
|
||||
}
|
||||
|
||||
public static boolean isIdealEnabled() {
|
||||
return isEnabledE164Start(FeatureFlags.idealEnabledRegions());
|
||||
return isEnabledE164Start(RemoteConfig.idealEnabledRegions());
|
||||
}
|
||||
|
||||
public static boolean isSepaEnabled() {
|
||||
return isEnabledE164Start(FeatureFlags.sepaEnabledRegions());
|
||||
return isEnabledE164Start(RemoteConfig.sepaEnabledRegions());
|
||||
}
|
||||
|
||||
public static boolean isDelayedNotificationPromptEnabled() {
|
||||
return FeatureFlags.internalUser() || isEnabledPartsPerMillion(FeatureFlags.PROMPT_FOR_NOTIFICATION_LOGS, FeatureFlags.promptForDelayedNotificationLogs());
|
||||
return RemoteConfig.internalUser() || isEnabledPartsPerMillion(RemoteConfig.PROMPT_FOR_NOTIFICATION_LOGS, RemoteConfig.promptForDelayedNotificationLogs());
|
||||
}
|
||||
|
||||
public static boolean isBatterySaverPromptEnabled() {
|
||||
return FeatureFlags.internalUser() || isEnabledPartsPerMillion(FeatureFlags.PROMPT_BATTERY_SAVER, FeatureFlags.promptBatterySaver());
|
||||
return RemoteConfig.internalUser() || isEnabledPartsPerMillion(RemoteConfig.PROMPT_BATTERY_SAVER, RemoteConfig.promptBatterySaver());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,16 +25,15 @@ import kotlin.time.Duration.Companion.minutes
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
/**
|
||||
* A location for flags that can be set locally and remotely. These flags can guard features that
|
||||
* are not yet ready to be activated.
|
||||
* A location for accessing remotely-configured values.
|
||||
*
|
||||
* When creating a new flag:
|
||||
* When creating a new config:
|
||||
* - At the bottom of the file, create a new `val` with the name you'd like.
|
||||
* - Use one of the helper delegates, like [remoteBoolean] or [remoteValue], to define your `val`.
|
||||
* - See the documentation for [Config] understand all of the fields.
|
||||
* - See the documentation for [Config] to understand all of the fields.
|
||||
*/
|
||||
object FeatureFlags {
|
||||
private val TAG = Log.tag(FeatureFlags::class.java)
|
||||
object RemoteConfig {
|
||||
private val TAG = Log.tag(RemoteConfig::class.java)
|
||||
|
||||
// region Core behavior
|
||||
|
||||
@@ -851,7 +850,7 @@ object FeatureFlags {
|
||||
@JvmStatic
|
||||
@get:JvmName("promptForDelayedNotificationLogs")
|
||||
val promptForDelayedNotificationLogs: String by remoteString(
|
||||
key = FeatureFlags.PROMPT_FOR_NOTIFICATION_LOGS,
|
||||
key = RemoteConfig.PROMPT_FOR_NOTIFICATION_LOGS,
|
||||
defaultValue = "*",
|
||||
hotSwappable = true
|
||||
)
|
||||
@@ -24,7 +24,7 @@ public final class RemoteDeprecation {
|
||||
* there's no pending expiration.
|
||||
*/
|
||||
public static long getTimeUntilDeprecation(long currentTime) {
|
||||
return getTimeUntilDeprecation(FeatureFlags.clientExpiration(), currentTime, BuildConfig.VERSION_NAME);
|
||||
return getTimeUntilDeprecation(RemoteConfig.clientExpiration(), currentTime, BuildConfig.VERSION_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user