mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Add "Backups Subscription not found" states.
This commit is contained in:
@@ -43,6 +43,7 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
private const val KEY_ARCHIVE_UPLOAD_STATE = "backup.archiveUploadState"
|
||||
|
||||
private const val KEY_BACKUP_UPLOADED = "backup.backupUploaded"
|
||||
private const val KEY_SUBSCRIPTION_STATE_MISMATCH = "backup.subscriptionStateMismatch"
|
||||
|
||||
private val cachedCdnCredentialsExpiresIn: Duration = 12.hours
|
||||
}
|
||||
@@ -73,6 +74,12 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
*/
|
||||
val latestBackupTier: MessageBackupTier? by enumValue(KEY_LATEST_BACKUP_TIER, null, MessageBackupTier.Serializer)
|
||||
|
||||
/**
|
||||
* Denotes if there was a mismatch detected between the user's Signal subscription, on-device Google Play subscription,
|
||||
* and what zk authorization we think we have.
|
||||
*/
|
||||
var subscriptionStateMismatchDetected: Boolean by booleanValue(KEY_SUBSCRIPTION_STATE_MISMATCH, false)
|
||||
|
||||
/**
|
||||
* When seting the backup tier, we also want to write to the latestBackupTier, as long as
|
||||
* the value is non-null. This gives us a 1-deep history of the selected backup tier for
|
||||
|
||||
@@ -469,6 +469,7 @@ class InAppPaymentValues internal constructor(store: KeyValueStore) : SignalStor
|
||||
}
|
||||
markDonationManuallyCancelled()
|
||||
} else {
|
||||
SignalStore.backup.subscriptionStateMismatchDetected = false
|
||||
markBackupSubscriptionpManuallyCancelled()
|
||||
|
||||
SignalStore.backup.disableBackups()
|
||||
@@ -513,6 +514,7 @@ class InAppPaymentValues internal constructor(store: KeyValueStore) : SignalStor
|
||||
} else {
|
||||
clearBackupSubscriptionManuallyCancelled()
|
||||
|
||||
SignalStore.backup.subscriptionStateMismatchDetected = false
|
||||
SignalStore.backup.backupTier = MessageBackupTier.PAID
|
||||
SignalStore.uiHints.markHasEverEnabledRemoteBackups()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user