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

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

Issue 2064323004: Defines initial DeviceConditions and and plumbs down through StartProcessing() call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 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 6f785286002d36bb46264c968414c894ac38da48..430f6b76cc1dfd9a4c36deaf9d172021d2b5fa77 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
@@ -24,8 +24,11 @@ public class BackgroundSchedulerBridge {
// not receive a callback.
// TODO(dougarnett): consider adding policy check api to let caller
// separately determine if not allowed by policy.
- public static boolean startProcessing(Callback<Boolean> callback) {
- return nativeStartProcessing(callback);
+ public static boolean startProcessing(
+ DeviceConditions deviceConditions, Callback<Boolean> callback) {
+ return nativeStartProcessing(deviceConditions.isPowerConnected(),
+ deviceConditions.getBatteryPercentage(), deviceConditions.getNetConnectionType(),
+ callback);
}
@CalledByNative
@@ -38,6 +41,6 @@ public class BackgroundSchedulerBridge {
BackgroundScheduler.unschedule(ContextUtils.getApplicationContext());
}
- private static native boolean nativeStartProcessing(
- Callback<Boolean> callback);
+ private static native boolean nativeStartProcessing(boolean powerConnected,
+ int batteryPercentage, int netConnectionType, Callback<Boolean> callback);
}

Powered by Google App Engine
This is Rietveld 408576698