mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Check backups state whenever the app is brought to foreground.
This commit is contained in:
committed by
Greyson Parrelli
parent
5bc8435d25
commit
8c63977775
@@ -53,6 +53,7 @@ import org.thoughtcrime.securesms.emoji.EmojiSource;
|
||||
import org.thoughtcrime.securesms.emoji.JumboEmoji;
|
||||
import org.thoughtcrime.securesms.gcm.FcmFetchManager;
|
||||
import org.thoughtcrime.securesms.jobs.AccountConsistencyWorkerJob;
|
||||
import org.thoughtcrime.securesms.jobs.BackupSubscriptionCheckJob;
|
||||
import org.thoughtcrime.securesms.jobs.BuildExpirationConfirmationJob;
|
||||
import org.thoughtcrime.securesms.jobs.CheckServiceReachabilityJob;
|
||||
import org.thoughtcrime.securesms.jobs.DownloadLatestEmojiDataJob;
|
||||
@@ -254,6 +255,10 @@ public class ApplicationContext extends Application implements AppForegroundObse
|
||||
checkBuildExpiration();
|
||||
MemoryTracker.start();
|
||||
|
||||
if (RemoteConfig.messageBackups()) {
|
||||
AppDependencies.getJobManager().add(BackupSubscriptionCheckJob.create());
|
||||
}
|
||||
|
||||
long lastForegroundTime = SignalStore.misc().getLastForegroundTime();
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long timeDiff = currentTime - lastForegroundTime;
|
||||
|
||||
@@ -29,6 +29,7 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
|
||||
|
||||
const val KEY = "BackupSubscriptionCheckJob"
|
||||
|
||||
@JvmStatic
|
||||
fun create(): BackupSubscriptionCheckJob {
|
||||
return BackupSubscriptionCheckJob(
|
||||
Parameters.Builder()
|
||||
|
||||
Reference in New Issue
Block a user