mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Move check to job method.
This commit is contained in:
committed by
Greyson Parrelli
parent
fa425567bf
commit
861ef4d708
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.thoughtcrime.securesms.jobs
|
||||
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import org.signal.core.util.billing.BillingPurchaseResult
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.donations.InAppPaymentType
|
||||
@@ -29,7 +30,7 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
|
||||
|
||||
const val KEY = "BackupSubscriptionCheckJob"
|
||||
|
||||
@JvmStatic
|
||||
@VisibleForTesting
|
||||
fun create(): BackupSubscriptionCheckJob {
|
||||
return BackupSubscriptionCheckJob(
|
||||
Parameters.Builder()
|
||||
@@ -40,6 +41,17 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
|
||||
.build()
|
||||
)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun enqueueIfAble() {
|
||||
if (!RemoteConfig.messageBackups) {
|
||||
return
|
||||
}
|
||||
|
||||
val job = create()
|
||||
|
||||
AppDependencies.jobManager.add(job)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun doRun(): Result {
|
||||
|
||||
Reference in New Issue
Block a user