Add a megaphone to celebrate Valentine's Day.

This commit is contained in:
Greyson Parrelli
2022-02-09 19:16:19 -05:00
parent 65af5f0849
commit 597cf3f576
5 changed files with 142 additions and 18 deletions

View File

@@ -63,6 +63,7 @@ public final class FeatureFlags {
private static final String PHONE_NUMBER_PRIVACY_VERSION = "android.phoneNumberPrivacyVersion";
private static final String CLIENT_EXPIRATION = "android.clientExpiration";
public static final String DONATE_MEGAPHONE = "android.donate.2";
public static final String VALENTINES_DONATE_MEGAPHONE = "android.donate.valentines.2022";
private static final String CUSTOM_VIDEO_MUXER = "android.customVideoMuxer";
private static final String CDS_REFRESH_INTERVAL = "cds.syncInterval.seconds";
private static final String AUTOMATIC_SESSION_RESET = "android.automaticSessionReset.2";
@@ -132,7 +133,8 @@ public final class FeatureFlags {
DONOR_BADGES_DISPLAY,
CHANGE_NUMBER_ENABLED,
HARDWARE_AEC_MODELS,
FORCE_DEFAULT_AEC
FORCE_DEFAULT_AEC,
VALENTINES_DONATE_MEGAPHONE
);
@VisibleForTesting
@@ -187,7 +189,8 @@ public final class FeatureFlags {
SENDER_KEY_MAX_AGE,
DONOR_BADGES_DISPLAY,
DONATE_MEGAPHONE,
FORCE_DEFAULT_AEC
FORCE_DEFAULT_AEC,
VALENTINES_DONATE_MEGAPHONE
);
/**
@@ -303,6 +306,11 @@ public final class FeatureFlags {
return getString(DONATE_MEGAPHONE, "");
}
/** The raw valentine's day donate megaphone CSV string */
public static String valentinesDonateMegaphone() {
return getString(VALENTINES_DONATE_MEGAPHONE, "");
}
/**
* Whether the user can choose phone number privacy settings, and;
* Whether to fetch and store the secondary certificate

View File

@@ -37,6 +37,13 @@ public final class LocaleFeatureFlags {
return isEnabled(FeatureFlags.DONATE_MEGAPHONE, FeatureFlags.donateMegaphone());
}
/**
* In valentines donation megaphone group for given country code
*/
public static boolean isInValentinesDonateMegaphone() {
return isEnabled(FeatureFlags.VALENTINES_DONATE_MEGAPHONE, FeatureFlags.valentinesDonateMegaphone());
}
public static @NonNull Optional<PushMediaConstraints.MediaConfig> getMediaQualityLevel() {
Map<String, Integer> countryValues = parseCountryValues(FeatureFlags.getMediaQualityLevels(), NOT_FOUND);
int level = getCountryValue(countryValues, Recipient.self().getE164().or(""), NOT_FOUND);