Put custom controller behind feature flag.

This commit is contained in:
Nicholas Tinsley
2024-03-27 14:35:52 -04:00
parent 42450024fc
commit f126df2120
10 changed files with 304 additions and 90 deletions

View File

@@ -128,6 +128,7 @@ public final class FeatureFlags {
private static final String LINKED_DEVICE_LIFESPAN_SECONDS = "android.linkedDeviceLifespanSeconds";
private static final String MESSAGE_BACKUPS = "android.messageBackups";
private static final String NICKNAMES = "android.nicknames";
private static final String CAMERAX_CUSTOM_CONTROLLER = "android.cameraXCustomController";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -207,7 +208,8 @@ public final class FeatureFlags {
CDSI_LIBSIGNAL_NET,
RX_MESSAGE_SEND,
LINKED_DEVICE_LIFESPAN_SECONDS,
NICKNAMES
NICKNAMES,
CAMERAX_CUSTOM_CONTROLLER
);
@VisibleForTesting
@@ -283,7 +285,8 @@ public final class FeatureFlags {
PREKEY_FORCE_REFRESH_INTERVAL,
CDSI_LIBSIGNAL_NET,
RX_MESSAGE_SEND,
LINKED_DEVICE_LIFESPAN_SECONDS
LINKED_DEVICE_LIFESPAN_SECONDS,
CAMERAX_CUSTOM_CONTROLLER
);
/**
@@ -747,6 +750,11 @@ public final class FeatureFlags {
return getBoolean(NICKNAMES, false);
}
/** Whether or not to use the custom CameraX controller class */
public static boolean customCameraXController() {
return getBoolean(CAMERAX_CUSTOM_CONTROLLER, false);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);