-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e201957
commit 1ce8ac2
Showing
9 changed files
with
206 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 14 additions & 10 deletions
24
app/src/main/java/org/thoughtcrime/securesms/keyvalue/RemoteConfigValues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,46 @@ | ||
package org.thoughtcrime.securesms.keyvalue; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import org.thoughtcrime.securesms.logging.Log; | ||
|
||
public final class RemoteConfigValues { | ||
public final class RemoteConfigValues extends SignalStoreValues { | ||
|
||
private static final String TAG = Log.tag(RemoteConfigValues.class); | ||
|
||
private static final String CURRENT_CONFIG = "remote_config"; | ||
private static final String PENDING_CONFIG = "pending_remote_config"; | ||
private static final String LAST_FETCH_TIME = "remote_config_last_fetch_time"; | ||
|
||
private final KeyValueStore store; | ||
RemoteConfigValues(@NonNull KeyValueStore store) { | ||
super(store); | ||
} | ||
|
||
RemoteConfigValues(KeyValueStore store) { | ||
this.store = store; | ||
@Override | ||
void onFirstEverAppLaunch() { | ||
} | ||
|
||
public String getCurrentConfig() { | ||
return store.getString(CURRENT_CONFIG, null); | ||
return getString(CURRENT_CONFIG, null); | ||
} | ||
|
||
public void setCurrentConfig(String value) { | ||
store.beginWrite().putString(CURRENT_CONFIG, value).apply(); | ||
putString(CURRENT_CONFIG, value); | ||
} | ||
|
||
public String getPendingConfig() { | ||
return store.getString(PENDING_CONFIG, getCurrentConfig()); | ||
return getString(PENDING_CONFIG, getCurrentConfig()); | ||
} | ||
|
||
public void setPendingConfig(String value) { | ||
store.beginWrite().putString(PENDING_CONFIG, value).apply(); | ||
putString(PENDING_CONFIG, value); | ||
} | ||
|
||
public long getLastFetchTime() { | ||
return store.getLong(LAST_FETCH_TIME, 0); | ||
return getLong(LAST_FETCH_TIME, 0); | ||
} | ||
|
||
public void setLastFetchTime(long time) { | ||
store.beginWrite().putLong(LAST_FETCH_TIME, time).apply(); | ||
putLong(LAST_FETCH_TIME, time); | ||
} | ||
} |
Oops, something went wrong.