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

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

Issue 2697493002: [Offline pages] Implementation of OfflineBackgroundTask using background_task_scheduler (Closed)
Patch Set: Addressing more feedback 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
Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java
index 15eca7e2938c02849512fb30acd433c695430f9a..1ed08e911e367e4fe89820faf3ff355e91c05254 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java
@@ -31,6 +31,15 @@ public class BackgroundSchedulerBridge {
callback);
}
+ /**
+ * Stops scheduled processing.
+ * @return true, as it always expects to be rescheduled.
+ */
+ public static boolean stopScheduledProcessing() {
+ nativeStopScheduledProcessing();
+ return true;
+ }
+
@CalledByNative
private static void schedule(TriggerConditions triggerConditions) {
BackgroundScheduler.getInstance(ContextUtils.getApplicationContext())
@@ -77,4 +86,6 @@ public class BackgroundSchedulerBridge {
/** Instructs the native RequestCoordinator to start processing. */
private static native boolean nativeStartScheduledProcessing(boolean powerConnected,
int batteryPercentage, int netConnectionType, Callback<Boolean> callback);
+ /** Instructs the native RequestCoordinator to stop processing. */
+ private static native void nativeStopScheduledProcessing();
}

Powered by Google App Engine
This is Rietveld 408576698