mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Flesh out restore paths for regv3.
This commit is contained in:
@@ -34,6 +34,7 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
private const val KEY_BACKUP_USED_MEDIA_SPACE = "backup.usedMediaSpace"
|
||||
private const val KEY_BACKUP_LAST_PROTO_SIZE = "backup.lastProtoSize"
|
||||
private const val KEY_BACKUP_TIER = "backup.backupTier"
|
||||
private const val KEY_BACKUP_TIER_RESTORED = "backup.backupTierRestored"
|
||||
private const val KEY_LATEST_BACKUP_TIER = "backup.latestBackupTier"
|
||||
private const val KEY_LAST_CHECK_IN_MILLIS = "backup.lastCheckInMilliseconds"
|
||||
private const val KEY_LAST_CHECK_IN_SNOOZE_MILLIS = "backup.lastCheckInSnoozeMilliseconds"
|
||||
@@ -167,12 +168,15 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
store.beginWrite()
|
||||
.putLong(KEY_BACKUP_TIER, serializedValue)
|
||||
.putLong(KEY_LATEST_BACKUP_TIER, serializedValue)
|
||||
.putBoolean(KEY_BACKUP_TIER_RESTORED, true)
|
||||
.apply()
|
||||
} else {
|
||||
putLong(KEY_BACKUP_TIER, serializedValue)
|
||||
}
|
||||
}
|
||||
|
||||
var isBackupTierRestored: Boolean by booleanValue(KEY_BACKUP_TIER_RESTORED, false)
|
||||
|
||||
/**
|
||||
* When uploading a backup, we store the progress state here so that it can remain across app restarts.
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,7 @@ class RegistrationValues internal constructor(store: KeyValueStore) : SignalStor
|
||||
private const val LOCAL_REGISTRATION_DATA = "registration.local_registration_data"
|
||||
private const val RESTORE_COMPLETED = "registration.backup_restore_completed"
|
||||
private const val RESTORE_METHOD_TOKEN = "registration.restore_method_token"
|
||||
private const val IS_OTHER_DEVICE_ANDROID = "registration.is_other_device_android"
|
||||
private const val RESTORING_ON_NEW_DEVICE = "registration.restoring_on_new_device"
|
||||
}
|
||||
|
||||
@@ -60,6 +61,8 @@ class RegistrationValues internal constructor(store: KeyValueStore) : SignalStor
|
||||
var hasUploadedProfile: Boolean by booleanValue(HAS_UPLOADED_PROFILE, true)
|
||||
var sessionId: String? by stringValue(SESSION_ID, null)
|
||||
var sessionE164: String? by stringValue(SESSION_E164, null)
|
||||
|
||||
var isOtherDeviceAndroid: Boolean by booleanValue(IS_OTHER_DEVICE_ANDROID, false)
|
||||
var restoreMethodToken: String? by stringValue(RESTORE_METHOD_TOKEN, null)
|
||||
|
||||
@get:JvmName("isRestoringOnNewDevice")
|
||||
|
||||
Reference in New Issue
Block a user