use of org.whispersystems.jobqueue.requirements.NetworkRequirement in project Signal-Android by WhisperSystems.
the class NetworkOrServiceRequirement method isPresent.
@Override
public boolean isPresent() {
NetworkRequirement networkRequirement = new NetworkRequirement(context);
ServiceRequirement serviceRequirement = new ServiceRequirement(context);
return networkRequirement.isPresent() || serviceRequirement.isPresent();
}
use of org.whispersystems.jobqueue.requirements.NetworkRequirement in project Signal-Android by WhisperSystems.
the class PushSendJob method constructParameters.
protected static JobParameters constructParameters(Context context, String destination) {
JobParameters.Builder builder = JobParameters.newBuilder();
builder.withPersistence();
builder.withGroupId(destination);
builder.withRequirement(new MasterSecretRequirement(context));
builder.withRequirement(new NetworkRequirement(context));
builder.withRetryCount(5);
return builder.create();
}
use of org.whispersystems.jobqueue.requirements.NetworkRequirement in project Signal-Android by WhisperSystems.
the class MessageRetrievalService method onCreate.
@Override
public void onCreate() {
super.onCreate();
ApplicationContext.getInstance(this).injectDependencies(this);
networkRequirement = new NetworkRequirement(this);
networkRequirementProvider = new NetworkRequirementProvider(this);
networkRequirementProvider.setListener(this);
retrievalThread = new MessageRetrievalThread();
retrievalThread.start();
setForegroundIfNecessary();
}
Aggregations