use of org.thoughtcrime.securesms.messages.RestStrategy in project Signal-Android by signalapp.
the class FcmJobService method onStartJob.
@Override
public boolean onStartJob(JobParameters params) {
Log.d(TAG, "onStartJob()");
if (BackgroundMessageRetriever.shouldIgnoreFetch()) {
Log.i(TAG, "App is foregrounded. No need to run.");
return false;
}
SignalExecutors.UNBOUNDED.execute(() -> {
Context context = getApplicationContext();
BackgroundMessageRetriever retriever = ApplicationDependencies.getBackgroundMessageRetriever();
boolean success = retriever.retrieveMessages(context, new RestStrategy(), new RestStrategy());
if (success) {
Log.i(TAG, "Successfully retrieved messages.");
jobFinished(params, false);
} else {
Log.w(TAG, "Failed to retrieve messages. Scheduling a retry.");
jobFinished(params, true);
}
});
return true;
}
Aggregations