mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Rename FeatureFlags -> RemoteConfig.
This commit is contained in:
@@ -39,7 +39,7 @@ import org.thoughtcrime.securesms.profiles.manage.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.username.NewWaysToConnectDialogFragment;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig;
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper;
|
||||
|
||||
@@ -104,7 +104,7 @@ public final class Megaphones {
|
||||
* The megaphones we want to display *in priority order*. This is a {@link LinkedHashMap}, so order is preserved.
|
||||
* We will render the first applicable megaphone in this collection.
|
||||
* <p>
|
||||
* This is also when you would hide certain megaphones based on things like {@link FeatureFlags}.
|
||||
* This is also when you would hide certain megaphones based on things like {@link RemoteConfig}.
|
||||
*/
|
||||
private static Map<Event, MegaphoneSchedule> buildDisplayOrder(@NonNull Context context, @NonNull Map<Event, MegaphoneRecord> records) {
|
||||
return new LinkedHashMap<>() {{
|
||||
@@ -132,7 +132,7 @@ public final class Megaphones {
|
||||
return false;
|
||||
}
|
||||
|
||||
long expiringAt = device.lastActiveTimestamp + FeatureFlags.getLinkedDeviceLifespan();
|
||||
long expiringAt = device.lastActiveTimestamp + RemoteConfig.getLinkedDeviceLifespan();
|
||||
long expiringIn = Math.max(expiringAt - System.currentTimeMillis(), 0);
|
||||
|
||||
return expiringIn < TimeUnit.DAYS.toMillis(7) && expiringIn > 0;
|
||||
@@ -177,7 +177,7 @@ public final class Megaphones {
|
||||
throw new IllegalStateException("No linked device to show");
|
||||
}
|
||||
|
||||
long expiringAt = device.lastActiveTimestamp + FeatureFlags.getLinkedDeviceLifespan();
|
||||
long expiringAt = device.lastActiveTimestamp + RemoteConfig.getLinkedDeviceLifespan();
|
||||
long expiringIn = Math.max(expiringAt - System.currentTimeMillis(), 0);
|
||||
int expiringDays = (int) TimeUnit.MILLISECONDS.toDays(expiringIn);
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.megaphone.RemoteMegaphoneRepository.Action
|
||||
import org.thoughtcrime.securesms.providers.BlobProvider
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LocaleFeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LocaleRemoteConfig
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.VersionTracker
|
||||
import java.util.Objects
|
||||
import kotlin.math.min
|
||||
@@ -89,7 +89,7 @@ object RemoteMegaphoneRepository {
|
||||
return db.getPotentialMegaphonesAndClearOld(now)
|
||||
.asSequence()
|
||||
.filter { it.imageUrl == null || it.imageUri != null }
|
||||
.filter { it.countries == null || LocaleFeatureFlags.shouldShowReleaseNote(it.uuid, it.countries) }
|
||||
.filter { it.countries == null || LocaleRemoteConfig.shouldShowReleaseNote(it.uuid, it.countries) }
|
||||
.filter { it.conditionalId == null || checkCondition(it.conditionalId) }
|
||||
.filter { it.snoozedAt == 0L || checkSnooze(it, now) }
|
||||
.firstOrNull()
|
||||
@@ -112,7 +112,7 @@ object RemoteMegaphoneRepository {
|
||||
private fun checkCondition(conditionalId: String): Boolean {
|
||||
return when (conditionalId) {
|
||||
"standard_donate" -> shouldShowDonateMegaphone()
|
||||
"internal_user" -> FeatureFlags.internalUser
|
||||
"internal_user" -> RemoteConfig.internalUser
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user