| Index: android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java b/android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java
|
| index 42525e0cc248a4430e8540e5896d64562f689236..6f103d656d65356385a5147ac24df12f81fa9b7a 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java
|
| @@ -7,18 +7,18 @@ package org.chromium.android_webview.crash;
|
| import android.annotation.TargetApi;
|
| import android.app.Service;
|
| import android.app.job.JobInfo;
|
| -import android.app.job.JobScheduler;
|
| -import android.content.ComponentName;
|
| import android.content.Context;
|
| import android.content.Intent;
|
| import android.os.Binder;
|
| import android.os.Build;
|
| import android.os.IBinder;
|
| import android.os.ParcelFileDescriptor;
|
| +import android.os.PersistableBundle;
|
|
|
| import org.chromium.base.Log;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.components.minidump_uploader.CrashFileManager;
|
| +import org.chromium.components.minidump_uploader.MinidumpUploadJobService;
|
|
|
| import java.io.File;
|
| import java.io.IOException;
|
| @@ -33,13 +33,6 @@ public class CrashReceiverService extends Service {
|
| private static final String WEBVIEW_CRASH_DIR = "WebView_Crashes";
|
| private static final String WEBVIEW_TMP_CRASH_DIR = "WebView_Crashes_Tmp";
|
|
|
| - private static final int MINIDUMP_UPLOADING_JOB_ID = 42;
|
| - // Initial back-off time for upload-job, this is set to a fairly high number (30 minutes) to
|
| - // increase the chance of performing uploads in batches if the initial upload fails.
|
| - private static final int JOB_BACKOFF_TIME_IN_MS = 1000 * 60 * 30;
|
| - // Back-off policy for upload-job.
|
| - private static final int JOB_BACKOFF_POLICY = JobInfo.BACKOFF_POLICY_EXPONENTIAL;
|
| -
|
| private Object mCopyingLock = new Object();
|
| private boolean mIsCopying = false;
|
|
|
| @@ -75,7 +68,8 @@ public class CrashReceiverService extends Service {
|
| boolean copySucceeded = copyMinidumps(context, uid, fileDescriptors);
|
| if (copySucceeded && scheduleUploads) {
|
| // Only schedule a new job if there actually are any files to upload.
|
| - scheduleNewJob();
|
| + MinidumpUploadJobService.scheduleUpload(this, AwMinidumpUploadJobService.class,
|
| + JobInfo.NETWORK_TYPE_UNMETERED, PersistableBundle.EMPTY);
|
| }
|
| } finally {
|
| synchronized (mCopyingLock) {
|
| @@ -104,23 +98,6 @@ public class CrashReceiverService extends Service {
|
| }
|
| }
|
|
|
| - private void scheduleNewJob() {
|
| - JobScheduler jobScheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
| - JobInfo newJob = new JobInfo
|
| - .Builder(MINIDUMP_UPLOADING_JOB_ID /* jobId */,
|
| - new ComponentName(this, AwMinidumpUploadJobService.class))
|
| - .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED)
|
| - // Minimum delay when a job is retried (a retry will happen when
|
| - // there are minidumps left after trying to upload all minidumps -
|
| - // this could e.g. happen if we add more minidumps at the same time
|
| - // as uploading old ones).
|
| - .setBackoffCriteria(JOB_BACKOFF_TIME_IN_MS, JOB_BACKOFF_POLICY)
|
| - .build();
|
| - if (jobScheduler.schedule(newJob) == JobScheduler.RESULT_FAILURE) {
|
| - throw new RuntimeException("couldn't schedule " + newJob);
|
| - }
|
| - }
|
| -
|
| /**
|
| * Copy minidumps from the {@param fileDescriptors} to the directory where WebView stores its
|
| * minidump files. {@param context} is used to look up the directory in which the files will be
|
|
|