Allow different accounts on same Google account to subscribe to backups.

This commit is contained in:
Alex Hart
2025-06-11 14:10:46 -03:00
committed by Michelle Tang
parent 5c61832d82
commit a5496c692f
3 changed files with 13 additions and 15 deletions

View File

@@ -110,18 +110,6 @@ class MessageBackupsFlowViewModel(
Log.d(TAG, "Got successful purchase result for purchase at ${result.purchaseTime}")
val id = internalStateFlow.value.inAppPayment!!.id
if (result.isAcknowledged) {
Log.w(TAG, "Payment is already acknowledged. Ignoring.")
internalStateFlow.update {
it.copy(
stage = MessageBackupsStage.COMPLETED
)
}
return@collect
}
try {
Log.d(TAG, "Attempting to handle successful purchase.")

View File

@@ -140,8 +140,9 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
null
}
if (purchaseToken?.let { hasLocalDevicePurchaseTokenMismatch(purchaseToken) } == true) {
Log.i(TAG, "Encountered token mismatch. Attempting to redeem.")
val hasTokenMismatch = purchaseToken?.let { hasLocalDevicePurchaseTokenMismatch(purchaseToken) } == true
if (hasActiveSignalSubscription && hasTokenMismatch) {
Log.i(TAG, "Encountered token mismatch with an active Signal subscription. Attempting to redeem against latest token.")
enqueueRedemptionForNewToken(purchaseToken, product.price)
SignalStore.backup.subscriptionStateMismatchDetected = false
return Result.success()