Enforce a local GV2 capacity limit driven by a feature flag.

This commit is contained in:
Alan Evans
2020-05-29 12:20:07 -03:00
committed by Greyson Parrelli
parent cfcd451db7
commit 9da309ca48
8 changed files with 129 additions and 18 deletions

View File

@@ -65,6 +65,7 @@ public final class FeatureFlags {
private static final String VERSIONED_PROFILES = "android.versionedProfiles";
private static final String GROUPS_V2 = "android.groupsv2";
private static final String GROUPS_V2_CREATE = "android.groupsv2.create";
private static final String GROUPS_V2_CAPACITY = "android.groupsv2.capacity";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -87,6 +88,7 @@ public final class FeatureFlags {
VERSIONED_PROFILES,
GROUPS_V2,
GROUPS_V2_CREATE,
GROUPS_V2_CAPACITY,
NEW_GROUP_UI
);
@@ -283,6 +285,13 @@ public final class FeatureFlags {
return groupsV2() && getBoolean(GROUPS_V2_CREATE, false);
}
/**
* Maximum number of members allowed in a group.
*/
public static int gv2GroupCapacity() {
return getInteger(GROUPS_V2_CAPACITY, 100);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);