mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Add verify key megaphone.
This commit is contained in:
committed by
Jeffrey Starke
parent
c6afa17330
commit
359f473b59
@@ -82,6 +82,10 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
|
||||
private const val KEY_MEDIA_ROOT_BACKUP_KEY = "backup.mediaRootBackupKey"
|
||||
|
||||
private const val KEY_LAST_VERIFY_KEY_TIME = "backup.last_verify_key_time"
|
||||
private const val KEY_HAS_SNOOZED_VERIFY = "backup.has_snoozed_verify"
|
||||
private const val KEY_HAS_VERIFIED_BEFORE = "backup.has_verified_before"
|
||||
|
||||
private val cachedCdnCredentialsExpiresIn: Duration = 12.hours
|
||||
|
||||
private val lock = ReentrantLock()
|
||||
@@ -299,6 +303,9 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
.putLong(KEY_NEXT_BACKUP_TIME, -1)
|
||||
.putBoolean(KEY_BACKUPS_INITIALIZED, false)
|
||||
.putBoolean(KEY_BACKUP_UPLOADED, false)
|
||||
.putLong(KEY_LAST_VERIFY_KEY_TIME, -1)
|
||||
.putBoolean(KEY_HAS_VERIFIED_BEFORE, false)
|
||||
.putBoolean(KEY_HAS_SNOOZED_VERIFY, false)
|
||||
.apply()
|
||||
backupTier = null
|
||||
backupTierInternalOverride = null
|
||||
@@ -324,6 +331,15 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
|
||||
var isNoBackupForManualUploadNotified by booleanValue(KEY_MANUAL_NO_BACKUP_NOTIFIED, false)
|
||||
|
||||
/** Last time they successfully entered their backup key, including when they first initialized backups **/
|
||||
var lastVerifyKeyTime by longValue(KEY_LAST_VERIFY_KEY_TIME, -1)
|
||||
|
||||
/** Checks if they have previously snoozed the megaphone to verify their backup key **/
|
||||
var hasSnoozedVerified by booleanValue(KEY_HAS_SNOOZED_VERIFY, false)
|
||||
|
||||
/** Checks if they have ever verified their backup key before **/
|
||||
var hasVerifiedBefore by booleanValue(KEY_HAS_VERIFIED_BEFORE, false)
|
||||
|
||||
/**
|
||||
* If true, it means we have been told that remote storage is full, but we have not yet run any of our "garbage collection" tasks, like committing deletes
|
||||
* or pruning orphaned media.
|
||||
|
||||
Reference in New Issue
Block a user