Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1895)

Unified Diff: android_webview/java/src/org/chromium/android_webview/crash/CrashReceiverService.java

Issue 2682913006: [Android WebView] Always schedule new upload job after copying minidump. (Closed)
Patch Set: Added inline comments explaining the new (non-)cancellation behaviour. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/crash/MinidumpUploaderImpl.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 53d6897441e1ee15605cc3730a034793a76b5bd2..ecd8c0a607c5a08adf8cb70a40801887a1bcc6a1 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
@@ -22,7 +22,6 @@ import org.chromium.components.minidump_uploader.CrashFileManager;
import java.io.File;
import java.io.IOException;
-import java.util.List;
/**
* Service that is responsible for receiving crash dumps from an application, for upload.
@@ -76,7 +75,7 @@ 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.
- scheduleNewJobIfNoJobsActive();
+ scheduleNewJob();
}
} finally {
synchronized (mCopyingLock) {
@@ -105,23 +104,8 @@ public class CrashReceiverService extends Service {
}
}
- /**
- * @return the currently pending job with ID MINIDUMP_UPLOADING_JOB_ID, or null if no such job
- * exists.
- */
- private static JobInfo getCurrentPendingJob(JobScheduler jobScheduler) {
- List<JobInfo> pendingJobs = jobScheduler.getAllPendingJobs();
- for (JobInfo job : pendingJobs) {
- if (job.getId() == MINIDUMP_UPLOADING_JOB_ID) return job;
- }
- return null;
- }
-
- private void scheduleNewJobIfNoJobsActive() {
+ private void scheduleNewJob() {
JobScheduler jobScheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
- if (getCurrentPendingJob(jobScheduler) != null) {
- return;
- }
JobInfo newJob = new JobInfo
.Builder(MINIDUMP_UPLOADING_JOB_ID /* jobId */,
new ComponentName(this, MinidumpUploadJobService.class))
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/crash/MinidumpUploaderImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698