Make UpdateApkJob use a timed wakelock

Fixes #6514
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-04-10 09:25:52 -07:00
parent 0a4d1569fb
commit 92ea7549d4

View File

@ -26,6 +26,7 @@ import org.whispersystems.jobqueue.requirements.NetworkRequirement;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@ -39,7 +40,7 @@ public class UpdateApkJob extends ContextJob {
super(context, JobParameters.newBuilder()
.withGroupId(UpdateApkJob.class.getSimpleName())
.withRequirement(new NetworkRequirement(context))
.withWakeLock(true)
.withWakeLock(true, 30, TimeUnit.SECONDS)
.withRetryCount(2)
.create());
}