Add ability to hide contacts behind a feature flag.

This commit is contained in:
Alex Hart
2022-09-27 16:40:27 -03:00
committed by Cody Henthorne
parent a8a773db43
commit 04eeb434c9
19 changed files with 511 additions and 45 deletions

View File

@@ -106,6 +106,7 @@ public final class FeatureFlags {
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";
private static final String HIDE_CONTACTS = "android.hide.contacts";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -163,7 +164,8 @@ public final class FeatureFlags {
CDS_V2_LOAD_TEST,
SMS_EXPORTER,
CDS_V2_COMPAT,
STORIES_LOCALE
STORIES_LOCALE,
HIDE_CONTACTS
);
@VisibleForTesting
@@ -588,6 +590,16 @@ public final class FeatureFlags {
return getBoolean(CDS_V2_COMPAT, false);
}
/**
* Whether or not users can hide contacts.
*
* WARNING: This feature is intended to be enabled in tandem with other clients, as it modifies contact records.
* Here be dragons.
*/
public static boolean hideContacts() {
return getBoolean(HIDE_CONTACTS, false);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);