Add new log sections to backups.

This commit is contained in:
Alex Hart
2025-09-23 12:53:03 -03:00
committed by Jeffrey Starke
parent 93815a0504
commit 369085e162
2 changed files with 8 additions and 4 deletions

View File

@@ -6,9 +6,11 @@
package org.thoughtcrime.securesms.logsubmit
import android.content.Context
import com.google.android.gms.common.GoogleApiAvailability
import kotlinx.coroutines.runBlocking
import org.signal.donations.InAppPaymentType
import org.thoughtcrime.securesms.backup.v2.ArchiveRestoreProgress
import org.thoughtcrime.securesms.backup.v2.ui.subscription.GooglePlayServicesAvailability
import org.thoughtcrime.securesms.components.settings.app.subscription.DonationSerializationHelper.toFiatMoney
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentsRepository
import org.thoughtcrime.securesms.database.SignalDatabase
@@ -44,11 +46,13 @@ class LogSectionRemoteBackups : LogSection {
output.append("\n -- Subscription State\n")
val backupSubscriptionId = InAppPaymentsRepository.getSubscriber(InAppPaymentSubscriberRecord.Type.BACKUP)
val hasGooglePlayBilling = runBlocking { AppDependencies.billingApi.getApiAvailability().isSuccess }
val googlePlayBillingAccess = runBlocking { AppDependencies.billingApi.getApiAvailability() }
val googlePlayServicesAvailability = GooglePlayServicesAvailability.fromCode(GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context))
val inAppPayment = SignalDatabase.inAppPayments.getLatestInAppPaymentByType(InAppPaymentType.RECURRING_BACKUP)
output.append("Has backup subscription id: ${backupSubscriptionId != null}\n")
output.append("Has Google Play Billing: $hasGooglePlayBilling\n\n")
output.append("Google Play Billing state: $googlePlayBillingAccess\n")
output.append("Google Play Services state: $googlePlayServicesAvailability\n\n")
if (inAppPayment != null) {
output.append("IAP end of period (seconds): ${inAppPayment.endOfPeriodSeconds}\n")

View File

@@ -134,7 +134,7 @@ internal class BillingApiImpl(
}
BillingResponseCode.ITEM_NOT_OWNED -> {
error("This shouldn't happen during the purchase process", true)
error("This shouldn't happen during the purchase process")
}
BillingResponseCode.ITEM_UNAVAILABLE -> {
@@ -204,7 +204,7 @@ internal class BillingApiImpl(
.setProductType(ProductType.SUBS)
.build()
val result = doOnConnectionReady("queryPurchases", true) {
val result = doOnConnectionReady("queryPurchases") {
billingClient.queryPurchasesAsync(param)
}