mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Add support for remote feature flags.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
@@ -10,12 +12,32 @@ import org.thoughtcrime.securesms.logging.SignalUncaughtExceptionHandler;
|
||||
*/
|
||||
public final class SignalStore {
|
||||
|
||||
private static final String REMOTE_CONFIG = "remote_config";
|
||||
private static final String REMOTE_CONFIG_LAST_FETCH_TIME = "remote_config_last_fetch_time";
|
||||
|
||||
private SignalStore() {}
|
||||
|
||||
public static KbsValues kbsValues() {
|
||||
return new KbsValues(getStore());
|
||||
}
|
||||
|
||||
public static String getRemoteConfig() {
|
||||
return getStore().getString(REMOTE_CONFIG, null);
|
||||
}
|
||||
|
||||
public static void setRemoteConfig(String value) {
|
||||
putString(REMOTE_CONFIG, value);
|
||||
}
|
||||
|
||||
public static long getRemoteConfigLastFetchTime() {
|
||||
return getStore().getLong(REMOTE_CONFIG_LAST_FETCH_TIME, 0);
|
||||
}
|
||||
|
||||
public static void setRemoteConfigLastFetchTime(long time) {
|
||||
putLong(REMOTE_CONFIG_LAST_FETCH_TIME, time);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ensures any pending writes are finished. Only intended to be called by
|
||||
* {@link SignalUncaughtExceptionHandler}.
|
||||
|
||||
Reference in New Issue
Block a user