mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Rename FeatureFlags -> RemoteConfig.
This commit is contained in:
@@ -6,7 +6,7 @@ import android.content.Context;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -30,7 +30,7 @@ public class DirectoryRefreshListener extends PersistentAlarmManagerListener {
|
||||
newTime = Math.min(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(6),
|
||||
SignalStore.misc().getCdsBlockedUtil());
|
||||
} else {
|
||||
newTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(FeatureFlags.cdsRefreshIntervalSeconds());
|
||||
newTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(RemoteConfig.cdsRefreshIntervalSeconds());
|
||||
TextSecurePreferences.setDirectoryRefreshTime(context, newTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import android.content.Context
|
||||
import org.thoughtcrime.securesms.backup.v2.BackupFrequency
|
||||
import org.thoughtcrime.securesms.jobs.BackupMessagesJob
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.toMillis
|
||||
import java.time.LocalDateTime
|
||||
import java.util.Random
|
||||
@@ -36,7 +36,7 @@ class MessageBackupListener : PersistentAlarmManagerListener() {
|
||||
|
||||
@JvmStatic
|
||||
fun schedule(context: Context?) {
|
||||
if (FeatureFlags.messageBackups && SignalStore.backup().areBackupsEnabled) {
|
||||
if (RemoteConfig.messageBackups && SignalStore.backup().areBackupsEnabled) {
|
||||
MessageBackupListener().onReceive(context, getScheduleIntent())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.webrtc.audio.SignalAudioManager
|
||||
|
||||
/**
|
||||
@@ -192,7 +192,7 @@ object AndroidTelecomUtil {
|
||||
}
|
||||
|
||||
private fun isTelecomAllowedForDevice(): Boolean {
|
||||
if (FeatureFlags.internalUser) {
|
||||
if (RemoteConfig.internalUser) {
|
||||
return !SignalStore.internalValues().callingDisableTelecom()
|
||||
}
|
||||
return RingRtcDynamicConfiguration.isTelecomAllowedForDevice()
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.thoughtcrime.securesms.notifications.profiles.NotificationProfiles;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.ringrtc.RemotePeer;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig;
|
||||
import org.whispersystems.signalservice.api.messages.calls.OfferMessage;
|
||||
import org.whispersystems.signalservice.api.push.ServiceId.ACI;
|
||||
|
||||
@@ -102,8 +102,8 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
|
||||
Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate);
|
||||
|
||||
int groupSize = remotePeerGroup.getRecipient().getParticipantIds().size();
|
||||
if (groupSize > FeatureFlags.maxGroupCallRingSize()) {
|
||||
Log.w(TAG, "Received ring request for large group, dropping. size: " + groupSize + " max: " + FeatureFlags.maxGroupCallRingSize());
|
||||
if (groupSize > RemoteConfig.maxGroupCallRingSize()) {
|
||||
Log.w(TAG, "Received ring request for large group, dropping. size: " + groupSize + " max: " + RemoteConfig.maxGroupCallRingSize());
|
||||
return currentState;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.os.Build
|
||||
import org.signal.core.util.asListContains
|
||||
import org.signal.ringrtc.CallManager.AudioProcessingMethod
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
|
||||
/**
|
||||
* Utility class to determine which AEC method RingRTC should use.
|
||||
@@ -22,19 +22,19 @@ object RingRtcDynamicConfiguration {
|
||||
return when {
|
||||
isHardwareBlocklisted() || isKnownFaultyHardwareImplementation() -> AudioProcessingMethod.ForceSoftwareAec3
|
||||
isSoftwareBlocklisted() -> AudioProcessingMethod.ForceHardware
|
||||
Build.VERSION.SDK_INT < 29 && FeatureFlags.useHardwareAecIfOlderThanApi29 -> AudioProcessingMethod.ForceHardware
|
||||
Build.VERSION.SDK_INT < 29 && RemoteConfig.useHardwareAecIfOlderThanApi29 -> AudioProcessingMethod.ForceHardware
|
||||
Build.VERSION.SDK_INT < 29 -> AudioProcessingMethod.ForceSoftwareAec3
|
||||
else -> AudioProcessingMethod.ForceHardware
|
||||
}
|
||||
}
|
||||
|
||||
fun isTelecomAllowedForDevice(): Boolean {
|
||||
return FeatureFlags.telecomManufacturerAllowList.lowercase().asListContains(Build.MANUFACTURER.lowercase()) &&
|
||||
!FeatureFlags.telecomModelBlocklist.lowercase().asListContains(Build.MODEL.lowercase())
|
||||
return RemoteConfig.telecomManufacturerAllowList.lowercase().asListContains(Build.MANUFACTURER.lowercase()) &&
|
||||
!RemoteConfig.telecomModelBlocklist.lowercase().asListContains(Build.MODEL.lowercase())
|
||||
}
|
||||
|
||||
private fun isHardwareBlocklisted(): Boolean {
|
||||
return FeatureFlags.hardwareAecBlocklistModels.asListContains(Build.MODEL)
|
||||
return RemoteConfig.hardwareAecBlocklistModels.asListContains(Build.MODEL)
|
||||
}
|
||||
|
||||
fun isKnownFaultyHardwareImplementation(): Boolean {
|
||||
@@ -44,6 +44,6 @@ object RingRtcDynamicConfiguration {
|
||||
}
|
||||
|
||||
private fun isSoftwareBlocklisted(): Boolean {
|
||||
return FeatureFlags.softwareAecBlocklistModels.asListContains(Build.MODEL)
|
||||
return RemoteConfig.softwareAecBlocklistModels.asListContains(Build.MODEL)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ import org.thoughtcrime.securesms.service.webrtc.links.SignalCallLinkManager;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcEphemeralState;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
|
||||
import org.thoughtcrime.securesms.util.AppForegroundObserver;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig;
|
||||
import org.thoughtcrime.securesms.util.RecipientAccessList;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
@@ -389,7 +389,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FeatureFlags.adHocCalling()) {
|
||||
if (!RemoteConfig.adHocCalling()) {
|
||||
Log.i(TAG, "Ad Hoc Calling is disabled. Ignoring request to peek.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.ForegroundServiceUtil;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig;
|
||||
import org.thoughtcrime.securesms.util.TelephonyUtil;
|
||||
import org.thoughtcrime.securesms.webrtc.CallNotificationBuilder;
|
||||
import org.thoughtcrime.securesms.webrtc.UncaughtExceptionHandlerManager;
|
||||
@@ -88,7 +88,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
private boolean stopping = false;
|
||||
|
||||
public synchronized static void update(@NonNull Context context, int type, @NonNull RecipientId recipientId, boolean isVideoCall) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.update(context, type, recipientId, isVideoCall);
|
||||
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public static void denyCall(@NonNull Context context) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.denyCall();
|
||||
return;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public static void hangup(@NonNull Context context) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.hangup();
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public synchronized static void stop(@NonNull Context context) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.stop();
|
||||
return;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public synchronized static @NonNull PendingIntent denyCallIntent(@NonNull Context context) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
return ActiveCallManager.denyCallIntent(context);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public synchronized static @NonNull PendingIntent hangupIntent(@NonNull Context context) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
return ActiveCallManager.hangupIntent(context);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public synchronized static void sendAudioManagerCommand(@NonNull Context context, @NonNull AudioManagerCommand command) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.sendAudioManagerCommand(context, command);
|
||||
return;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public synchronized static void changePowerButtonReceiver(@NonNull Context context, boolean register) {
|
||||
if (FeatureFlags.useActiveCallManager()) {
|
||||
if (RemoteConfig.useActiveCallManager()) {
|
||||
ActiveCallManager.changePowerButtonReceiver(context, register);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user