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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerJobService.java

Issue 2686203002: [Offline pages] Creating BackgroundJobScheduler, which uses JobScheduler (Closed)
Patch Set: Adding null checks 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.offlinepages;
6
7 import android.annotation.TargetApi;
8 import android.app.job.JobParameters;
9 import android.app.job.JobService;
10 import android.os.Build;
11
12 /**
13 * The background scheduler job service for handling background request in 5.1+.
14 */
15 @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
16 public class BackgroundSchedulerJobService extends JobService {
17 @Override
18 public boolean onStartJob(JobParameters params) {
19 // TODO(fgorski): Implement and expose in metadata.
20 // Perhaps initialize application context.
21 // Perhaps ensure one job runs at a time only.
22 // Kick off background processing of downloads here.
23 // Processing will happen on a separate thread, and we'll inform OS when done.
24 return true;
25 }
26
27 @Override
28 public boolean onStopJob(JobParameters params) {
29 // TODO(fgorski): Implement and expose in metadata.
30 // Issue a cancel signal to request coordinator.
31 // This is where synchronization might be necessary.
32 // If we didn't stop ourselves, that likely means there is more work to do.
33 return true;
34 }
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698