Upgrade SDK to 30.

This commit is contained in:
Alex Hart
2020-11-17 09:58:14 -04:00
parent 23618923d8
commit 75062ada8a
8 changed files with 39 additions and 39 deletions

View File

@@ -6,7 +6,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.annimon.stream.Stream;
import com.google.android.collect.Sets;
import org.json.JSONException;
import org.json.JSONObject;
@@ -72,8 +71,7 @@ public final class FeatureFlags {
* We will only store remote values for flags in this set. If you want a flag to be controllable
* remotely, place it in here.
*/
private static final Set<String> REMOTE_CAPABLE = Sets.newHashSet(
private static final Set<String> REMOTE_CAPABLE = SetUtil.newHashSet(
GROUPS_V2_RECOMMENDED_LIMIT,
GROUPS_V2_HARD_LIMIT,
GROUPS_V2_JOIN_VERSION,
@@ -108,7 +106,7 @@ public final class FeatureFlags {
* will be updated arbitrarily at runtime. This will make values more responsive, but also places
* more burden on the reader to ensure that the app experience remains consistent.
*/
private static final Set<String> HOT_SWAPPABLE = Sets.newHashSet(
private static final Set<String> HOT_SWAPPABLE = SetUtil.newHashSet(
GROUPS_V2_JOIN_VERSION,
VERIFY_V2,
CLIENT_EXPIRATION,
@@ -118,7 +116,7 @@ public final class FeatureFlags {
/**
* Flags in this set will stay true forever once they receive a true value from a remote config.
*/
private static final Set<String> STICKY = Sets.newHashSet(
private static final Set<String> STICKY = SetUtil.newHashSet(
VERIFY_V2
);

View File

@@ -1,6 +1,11 @@
package org.thoughtcrime.securesms.util;
import android.annotation.SuppressLint;
import com.google.android.collect.Sets;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -24,4 +29,9 @@ public final class SetUtil {
result.addAll(b);
return result;
}
@SuppressLint("NewApi")
public static <E> HashSet<E> newHashSet(E... elements) {
return Sets.newHashSet(elements);
}
}

View File

@@ -4,29 +4,26 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.text.BidiFormatter;
import com.google.android.collect.Sets;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Set;
public final class StringUtil {
private static final Set<Character> WHITESPACE = Sets.newHashSet('\u200E', // left-to-right mark
'\u200F', // right-to-left mark
'\u2007'); // figure space
private static final Set<Character> WHITESPACE = SetUtil.newHashSet('\u200E', // left-to-right mark
'\u200F', // right-to-left mark
'\u2007'); // figure space
private static final class Bidi {
/** Override text direction */
private static final Set<Integer> OVERRIDES = Sets.newHashSet("\u202a".codePointAt(0), /* LRE */
"\u202b".codePointAt(0), /* RLE */
"\u202d".codePointAt(0), /* LRO */
"\u202e".codePointAt(0) /* RLO */);
private static final Set<Integer> OVERRIDES = SetUtil.newHashSet("\u202a".codePointAt(0), /* LRE */
"\u202b".codePointAt(0), /* RLE */
"\u202d".codePointAt(0), /* LRO */
"\u202e".codePointAt(0) /* RLO */);
/** Set direction and isolate surrounding text */
private static final Set<Integer> ISOLATES = Sets.newHashSet("\u2066".codePointAt(0), /* LRI */
"\u2067".codePointAt(0), /* RLI */
"\u2068".codePointAt(0) /* FSI */);
private static final Set<Integer> ISOLATES = SetUtil.newHashSet("\u2066".codePointAt(0), /* LRI */
"\u2067".codePointAt(0), /* RLI */
"\u2068".codePointAt(0) /* FSI */);
/** Closes things in {@link #OVERRIDES} */
private static final int PDF = "\u202c".codePointAt(0);