Add user restore method selection plumbing to old device.

This commit is contained in:
Cody Henthorne
2024-11-13 15:01:04 -05:00
committed by Greyson Parrelli
parent b6bb3928e7
commit 75f0d3363b
22 changed files with 457 additions and 72 deletions

View File

@@ -14,6 +14,8 @@ class RegistrationValues internal constructor(store: KeyValueStore) : SignalStor
private const val SKIPPED_TRANSFER_OR_RESTORE = "registration.has_skipped_transfer_or_restore"
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 RESTORING_ON_NEW_DEVICE = "registration.restoring_on_new_device"
}
@Synchronized
@@ -58,6 +60,10 @@ 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 restoreMethodToken: String? by stringValue(RESTORE_METHOD_TOKEN, null)
@get:JvmName("isRestoringOnNewDevice")
var restoringOnNewDevice: Boolean by booleanValue(RESTORING_ON_NEW_DEVICE, false)
fun hasSkippedTransferOrRestore(): Boolean {
return getBoolean(SKIPPED_TRANSFER_OR_RESTORE, false)