mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Add more linked device checks to various jobs.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user