mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Move check to job method.
This commit is contained in:
committed by
Greyson Parrelli
parent
fa425567bf
commit
861ef4d708
@@ -254,10 +254,7 @@ public class ApplicationContext extends Application implements AppForegroundObse
|
||||
AppDependencies.getShakeToReport().enable();
|
||||
checkBuildExpiration();
|
||||
MemoryTracker.start();
|
||||
|
||||
if (RemoteConfig.messageBackups()) {
|
||||
AppDependencies.getJobManager().add(BackupSubscriptionCheckJob.create());
|
||||
}
|
||||
BackupSubscriptionCheckJob.enqueueIfAble();
|
||||
|
||||
long lastForegroundTime = SignalStore.misc().getLastForegroundTime();
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
@@ -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