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

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

Issue 2737093002: [Offline pages] Clean up of device conditions related code (Closed)
Patch Set: Compilation fix and small code update Created 3 years, 9 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.offlinepages; 5 package org.chromium.chrome.browser.offlinepages;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Build; 8 import android.os.Build;
9 9
10 import java.util.concurrent.TimeUnit; 10 import java.util.concurrent.TimeUnit;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 * For the given Triggering conditions, start a new GCM Network Manager requ est allowed 65 * For the given Triggering conditions, start a new GCM Network Manager requ est allowed
66 * to run after {@code delayStartSecs} seconds. 66 * to run after {@code delayStartSecs} seconds.
67 */ 67 */
68 protected abstract void scheduleImpl(TriggerConditions triggerConditions, 68 protected abstract void scheduleImpl(TriggerConditions triggerConditions,
69 long delayStartSeconds, long executionDeadlineSeconds, boolean overw rite); 69 long delayStartSeconds, long executionDeadlineSeconds, boolean overw rite);
70 70
71 /** @return Context used to access OS services. */ 71 /** @return Context used to access OS services. */
72 protected Context getContext() { 72 protected Context getContext() {
73 return mContext; 73 return mContext;
74 } 74 }
75
76 /**
77 * Get the latest power conditions from the android APIs.
78 */
79 public static boolean getPowerConditions(Context context) {
80 return OfflinePageUtils.getPowerConditions(context);
81 }
82
83 /**
84 * Get the latest battery conditions from the android APIs.
85 */
86 public static int getBatteryConditions(Context context) {
87 return OfflinePageUtils.getBatteryConditions(context);
88 }
89
90 /**
91 * Get the latest network conditions from the android APIs.
92 */
93 public static int getNetworkConditions(Context context) {
94 return OfflinePageUtils.getNetworkConditions(context);
95 }
96 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698