Implement new CDS changes.

This commit is contained in:
Greyson Parrelli
2020-07-02 10:38:52 -07:00
parent 1752972be9
commit 2791790bf5
22 changed files with 908 additions and 561 deletions

View File

@@ -63,6 +63,7 @@ public final class FeatureFlags {
private static final String GROUPS_V2_CREATE = "android.groupsv2.create";
private static final String GROUPS_V2_CAPACITY = "android.groupsv2.capacity";
private static final String GROUPS_V2_INTERNAL_TEST = "android.groupsv2.internalTest";
private static final String CDS = "android.cds";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -256,6 +257,11 @@ public final class FeatureFlags {
return groupsV2() && getBoolean(GROUPS_V2_INTERNAL_TEST, false);
}
/** Whether or not to use the new contact discovery service endpoint. */
public static boolean cds() {
return getBoolean(CDS, false);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);

View File

@@ -19,13 +19,9 @@ public final class SetUtil {
return difference;
}
public static <E> Set<E> union(Set<E>... sets) {
Set<E> result = new LinkedHashSet<>();
for (Set<E> set : sets) {
result.addAll(set);
}
public static <E> Set<E> union(Set<E> a, Set<E> b) {
Set<E> result = new LinkedHashSet<>(a);
result.addAll(b);
return result;
}
}