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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java

Issue 1699143002: [NTP Snippets] Schedule periodic fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_feature
Patch Set: fix bots Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
index ffec5a9a97de86c9519a8307f1eb4e39085b2a62..69537e47bdfe5f4170539e9cfa7588184efb4662 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
@@ -30,6 +30,8 @@ import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
public class BackgroundSyncLauncher {
private static final String TAG = "BgSyncLauncher";
+ public static final String TASK_TAG = "BackgroundSync Event";
+
static final String PREF_BACKGROUND_SYNC_LAUNCH_NEXT_ONLINE = "bgsync_launch_next_online";
// The instance of BackgroundSyncLauncher currently owned by a C++
// BackgroundSyncLauncherAndroid, if any. If it is non-null then the browser is running.
@@ -191,8 +193,8 @@ public class BackgroundSyncLauncher {
// the Play Store. In this case, scheduling the task will fail silently.
final long minDelaySecs = minDelayMs / 1000;
OneoffTask oneoff = new OneoffTask.Builder()
- .setService(BackgroundSyncLauncherService.class)
- .setTag("BackgroundSync Event")
+ .setService(ChromeBackgroundService.class)
+ .setTag(TASK_TAG)
// We have to set a non-zero execution window here
.setExecutionWindow(minDelaySecs, minDelaySecs + 1)
.setRequiredNetwork(Task.NETWORK_STATE_CONNECTED)
@@ -212,7 +214,7 @@ public class BackgroundSyncLauncher {
private static boolean removeScheduledTasks(GcmNetworkManager scheduler) {
try {
- scheduler.cancelAllTasks(BackgroundSyncLauncherService.class);
+ scheduler.cancelTask(TASK_TAG, ChromeBackgroundService.class);
} catch (IllegalArgumentException e) {
// This occurs when BackgroundSyncLauncherService is not found in the application
// manifest. This should not happen in code that reaches here, but has been seen in

Powered by Google App Engine
This is Rietveld 408576698