Add more linked device checks to various jobs.

This commit is contained in:
Cody Henthorne
2025-08-06 13:12:39 -04:00
parent 0df5ec458b
commit 95ff2886cd
3 changed files with 12 additions and 0 deletions

View File

@@ -76,6 +76,12 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
return Result.success()
}
if (SignalStore.account.isLinkedDevice) {
Log.i(TAG, "Linked device. Clearing mismatch value and exiting.", true)
SignalStore.backup.subscriptionStateMismatchDetected = false
return Result.success()
}
if (!RemoteConfig.messageBackups) {
Log.i(TAG, "Message backups feature is not available. Clearing mismatch value and exiting.", true)
SignalStore.backup.subscriptionStateMismatchDetected = false

View File

@@ -154,6 +154,11 @@ class InAppPaymentRecurringContextJob private constructor(
throw Exception("Unregistered users cannot perform this job.")
}
if (SignalStore.account.isLinkedDevice) {
warning("Linked device. Failing.")
throw Exception("Linked devices cannot not perform this job")
}
val (inAppPayment, requestContext) = getAndValidateInAppPayment()
val activeSubscription = getActiveSubscription(inAppPayment)
val subscription = activeSubscription.activeSubscription

View File

@@ -67,6 +67,7 @@ class InAppPaymentRecurringContextJobTest {
Log.initialize(SystemOutLogger())
every { mockSignalStore.account.isRegistered } returns true
every { mockSignalStore.account.isLinkedDevice } returns false
every { mockSignalStore.inAppPayments.setLastEndOfPeriod(any()) } returns Unit
recipientTable = mockk(relaxed = true)