Search in sources :

Example 1 with NetworkRequirement

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();
}
Also used : NetworkRequirement(org.whispersystems.jobqueue.requirements.NetworkRequirement)

Example 2 with NetworkRequirement

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();
}
Also used : MasterSecretRequirement(org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement) NetworkRequirement(org.whispersystems.jobqueue.requirements.NetworkRequirement) JobParameters(org.whispersystems.jobqueue.JobParameters)

Example 3 with NetworkRequirement

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();
}
Also used : NetworkRequirement(org.whispersystems.jobqueue.requirements.NetworkRequirement) NetworkRequirementProvider(org.whispersystems.jobqueue.requirements.NetworkRequirementProvider)

Aggregations

NetworkRequirement (org.whispersystems.jobqueue.requirements.NetworkRequirement)3 MasterSecretRequirement (org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement)1 JobParameters (org.whispersystems.jobqueue.JobParameters)1 NetworkRequirementProvider (org.whispersystems.jobqueue.requirements.NetworkRequirementProvider)1