Add basic CDSv2 database writes and unit tests.

This commit is contained in:
Greyson Parrelli
2022-05-16 12:15:11 -04:00
committed by Cody Henthorne
parent 307be5c75e
commit dda5ce4809
8 changed files with 324 additions and 27 deletions

View File

@@ -60,7 +60,6 @@ public final class FeatureFlags {
private static final String GROUP_NAME_MAX_LENGTH = "global.groupsv2.maxNameLength";
private static final String INTERNAL_USER = "android.internalUser";
private static final String VERIFY_V2 = "android.verifyV2";
private static final String PHONE_NUMBER_PRIVACY_VERSION = "android.phoneNumberPrivacyVersion";
private static final String CLIENT_EXPIRATION = "android.clientExpiration";
public static final String DONATE_MEGAPHONE = "android.donate.2";
private static final String CUSTOM_VIDEO_MUXER = "android.customVideoMuxer";
@@ -94,7 +93,7 @@ public final class FeatureFlags {
private static final String USE_HARDWARE_AEC_IF_OLD = "android.calling.useHardwareAecIfOlderThanApi29";
private static final String USE_AEC3 = "android.calling.useAec3";
private static final String PAYMENTS_COUNTRY_BLOCKLIST = "android.payments.blocklist";
private static final String PNP_CDS = "android.pnp.cds";
private static final String PHONE_NUMBER_PRIVACY = "android.pnp";
private static final String USE_FCM_FOREGROUND_SERVICE = "android.useFcmForegroundService.3";
private static final String STORIES_AUTO_DOWNLOAD_MAXIMUM = "android.stories.autoDownloadMaximum";
private static final String GIFT_BADGES = "android.giftBadges.2";
@@ -152,8 +151,7 @@ public final class FeatureFlags {
@VisibleForTesting
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(
PHONE_NUMBER_PRIVACY_VERSION,
PNP_CDS
PHONE_NUMBER_PRIVACY
);
/**
@@ -327,11 +325,11 @@ public final class FeatureFlags {
}
/**
* Whether the user can choose phone number privacy settings, and;
* Whether to fetch and store the secondary certificate
* Whether phone number privacy is enabled.
* IMPORTANT: This is under active development. Enabling this *will* break your contacts in terrible, irreversible ways.
*/
public static boolean phoneNumberPrivacy() {
return getVersionFlag(PHONE_NUMBER_PRIVACY_VERSION) == VersionFlag.ON;
return getBoolean(PHONE_NUMBER_PRIVACY, false) && Environment.IS_STAGING;
}
/** Whether to use the custom streaming muxer or built in android muxer. */
@@ -493,15 +491,6 @@ public final class FeatureFlags {
return getBoolean(USE_AEC3, true);
}
/**
* Whether or not to use the phone number privacy CDS flow. Only currently works in staging.
*
* Note: This feature is in very early stages of development and *will* break your contacts.
*/
public static boolean usePnpCds() {
return Environment.IS_STAGING && getBoolean(PNP_CDS, false);
}
public static boolean useFcmForegroundService() {
return getBoolean(USE_FCM_FOREGROUND_SERVICE, false);
}