mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Basic client usage of CDSHv2.
This provides a basic (read: useful-for-development-yet-broken) client usage of CDSHv2.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -19,6 +20,7 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
private static final String CENSORSHIP_LAST_CHECK_TIME = "misc.censorship.last_check_time";
|
||||
private static final String CENSORSHIP_SERVICE_REACHABLE = "misc.censorship.service_reachable";
|
||||
private static final String LAST_GV2_PROFILE_CHECK_TIME = "misc.last_gv2_profile_check_time";
|
||||
private static final String CDS_TOKEN = "misc.cds_token";
|
||||
|
||||
MiscellaneousValues(@NonNull KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -137,4 +139,14 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
public void setLastGv2ProfileCheckTime(long value) {
|
||||
putLong(LAST_GV2_PROFILE_CHECK_TIME, value);
|
||||
}
|
||||
|
||||
public @Nullable byte[] getCdsToken() {
|
||||
return getBlob(CDS_TOKEN, null);
|
||||
}
|
||||
|
||||
public void setCdsToken(@Nullable byte[] token) {
|
||||
getStore().beginWrite()
|
||||
.putBlob(CDS_TOKEN, token)
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user