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

Unified Diff: components/precache/android/java/src/org/chromium/components/precache/DeviceState.java

Issue 1751183002: Precache uses GcmNetworkManager for task scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and fixed tests Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/precache/android/java/src/org/chromium/components/precache/DeviceState.java
diff --git a/components/precache/android/java/src/org/chromium/components/precache/DeviceState.java b/components/precache/android/java/src/org/chromium/components/precache/DeviceState.java
index 4342537b80f81aa2d28189095941f4a1a6a728b8..1a63a26a87b00b84882735e5daf7f8ba319c9236 100644
--- a/components/precache/android/java/src/org/chromium/components/precache/DeviceState.java
+++ b/components/precache/android/java/src/org/chromium/components/precache/DeviceState.java
@@ -7,7 +7,6 @@ package org.chromium.components.precache;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.net.ConnectivityManager;
import android.os.BatteryManager;
import org.chromium.base.VisibleForTesting;
@@ -59,12 +58,11 @@ public class DeviceState {
|| status == BatteryManager.BATTERY_STATUS_FULL;
}
- /** @return whether the currently active network is Wi-Fi, not roaming, and not metered. */
- public boolean isWifiAvailable(Context context) {
+ /** @return whether the currently active network is unmetered. */
+ public boolean isUnmeteredNetworkAvailable(Context context) {
NetworkInfoDelegate networkInfo =
mNetworkInfoDelegateFactory.getNetworkInfoDelegate(context);
return (networkInfo.isValid()
- && networkInfo.getType() == ConnectivityManager.TYPE_WIFI
&& networkInfo.isAvailable()
&& networkInfo.isConnected()
&& !networkInfo.isRoaming()

Powered by Google App Engine
This is Rietveld 408576698