Support enabling stories access by country.

This commit is contained in:
Alex Hart
2022-09-20 14:02:17 -03:00
committed by Cody Henthorne
parent a98cc5706f
commit 6c4c299b28
6 changed files with 51 additions and 6 deletions

View File

@@ -105,6 +105,7 @@ public final class FeatureFlags {
private static final String CDS_V2_LOAD_TEST = "android.cdsV2LoadTest";
private static final String SMS_EXPORTER = "android.sms.exporter";
private static final String CDS_V2_COMPAT = "android.cdsV2Compat.3";
public static final String STORIES_LOCALE = "android.stories.locale";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -161,7 +162,8 @@ public final class FeatureFlags {
RECIPIENT_MERGE_V2,
CDS_V2_LOAD_TEST,
SMS_EXPORTER,
CDS_V2_COMPAT
CDS_V2_COMPAT,
STORIES_LOCALE
);
@VisibleForTesting
@@ -481,6 +483,13 @@ public final class FeatureFlags {
return getBoolean(STORIES_TEXT_FUNCTIONS, false);
}
/**
* List of locales in which stories have been enabled. Overridden by the stories flag.
*/
public static @NonNull String storiesLocale() {
return getString(STORIES_LOCALE, "");
}
/**
* Whether or not donor badges should be displayed throughout the app.
*/

View File

@@ -44,6 +44,13 @@ public final class LocaleFeatureFlags {
return Optional.ofNullable(PushMediaConstraints.MediaConfig.forLevel(level));
}
/**
* In story group for given country code
*/
public static boolean isInStoriesCountry() {
return isEnabled(FeatureFlags.STORIES_LOCALE, FeatureFlags.storiesLocale());
}
/**
* Whether or not you should suggest SMS during onboarding.
*/