Add logging to check purchase information on RemoteBackupsSettings screen.

This commit is contained in:
Alex Hart
2025-06-06 13:01:38 -03:00
committed by Greyson Parrelli
parent 23d8969015
commit f9ee222d5d

View File

@@ -261,8 +261,14 @@ class RemoteBackupsSettingsViewModel : ViewModel() {
Log.d(TAG, "[subscriptionStateMismatchDetected] A mismatch was detected.")
val hasActiveGooglePlayBillingSubscription = when (val purchaseResult = AppDependencies.billingApi.queryPurchases()) {
is BillingPurchaseResult.Success -> purchaseResult.isAcknowledged && purchaseResult.isWithinTheLastMonth() && purchaseResult.isAutoRenewing
else -> false
is BillingPurchaseResult.Success -> {
Log.d(TAG, "[subscriptionStateMismatchDetected] Found a purchase: $purchaseResult")
purchaseResult.isAcknowledged && purchaseResult.isWithinTheLastMonth() && purchaseResult.isAutoRenewing
}
else -> {
Log.d(TAG, "[subscriptionStateMismatchDetected] No purchase found in Google Play Billing: $purchaseResult")
false
}
} || SignalStore.backup.backupTierInternalOverride == MessageBackupTier.PAID
Log.d(TAG, "[subscriptionStateMismatchDetected] hasActiveGooglePlayBillingSubscription: $hasActiveGooglePlayBillingSubscription")