Add support for smarter story downloads.

This commit is contained in:
Alex Hart
2022-04-21 17:29:02 -03:00
committed by Cody Henthorne
parent c4bc2162f2
commit 17111abc72
13 changed files with 125 additions and 15 deletions

View File

@@ -97,6 +97,7 @@ public final class FeatureFlags {
private static final String PAYMENTS_COUNTRY_BLOCKLIST = "android.payments.blocklist";
private static final String PNP_CDS = "android.pnp.cds";
private static final String USE_FCM_FOREGROUND_SERVICE = "android.useFcmForegroundService";
private static final String STORIES_AUTO_DOWNLOAD_MAXIMUM = "android.stories.autoDownloadMaximum";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -145,7 +146,8 @@ public final class FeatureFlags {
USE_HARDWARE_AEC_IF_OLD,
USE_AEC3,
PAYMENTS_COUNTRY_BLOCKLIST,
USE_FCM_FOREGROUND_SERVICE
USE_FCM_FOREGROUND_SERVICE,
STORIES_AUTO_DOWNLOAD_MAXIMUM
);
@VisibleForTesting
@@ -512,6 +514,13 @@ public final class FeatureFlags {
return getBoolean(USE_FCM_FOREGROUND_SERVICE, false);
}
/**
* Prefetch count for stories from a given user.
*/
public static int storiesAutoDownloadMaximum() {
return getInteger(STORIES_AUTO_DOWNLOAD_MAXIMUM, 2);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);