Index: net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java |
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java |
index ca9f7dcd7eefcd0ebc5d8762790a33f907750cb4..014871777a2afbbbc62c655bb6250065e7ca3dad 100644 |
--- a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java |
+++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java |
@@ -86,14 +86,6 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver { |
/** Queries the ConnectivityManager for information about the current connection. */ |
static class ConnectivityManagerDelegate { |
- private static final int NETWORK_INFO_DISCONNECTED = 0; |
- private static final int NETWORK_INFO_CONNECTED = 1; |
- private static final int NETWORK_INFO_ANDROID_API_LEVEL_TOO_OLD_FOR_UNBLOCKING = 2; |
- private static final int NETWORK_INFO_NOT_BLOCKED = 3; |
- private static final int NETWORK_INFO_APP_NOT_IN_FOREGROUND = 4; |
- private static final int NETWORK_INFO_UNBLOCKED = 5; |
- private static final int NETWORK_INFO_BOUNDARY = 6; |
- |
private final ConnectivityManager mConnectivityManager; |
ConnectivityManagerDelegate(Context context) { |
@@ -114,12 +106,10 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver { |
private NetworkInfo getActiveNetworkInfo() { |
final NetworkInfo networkInfo = mConnectivityManager.getActiveNetworkInfo(); |
if (networkInfo == null) { |
- recordGetActiveNetworkInfoResult(NETWORK_INFO_DISCONNECTED); |
return null; |
} |
if (networkInfo.isConnected()) { |
- recordGetActiveNetworkInfoResult(NETWORK_INFO_CONNECTED); |
return networkInfo; |
} |
@@ -128,38 +118,23 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver { |
// meant for apps in the background. See https://crbug.com/677365 for more details. |
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { |
// https://crbug.com/677365 primarily affects only Lollipop and higher versions. |
- recordGetActiveNetworkInfoResult( |
- NETWORK_INFO_ANDROID_API_LEVEL_TOO_OLD_FOR_UNBLOCKING); |
return null; |
} |
if (networkInfo.getDetailedState() != NetworkInfo.DetailedState.BLOCKED) { |
// Network state is not blocked which implies that network access is |
// unavailable (not just blocked to this app). |
- recordGetActiveNetworkInfoResult(NETWORK_INFO_NOT_BLOCKED); |
return null; |
} |
if (ApplicationStatus.getStateForApplication() |
!= ApplicationState.HAS_RUNNING_ACTIVITIES) { |
// The app is not in the foreground. |
- recordGetActiveNetworkInfoResult(NETWORK_INFO_APP_NOT_IN_FOREGROUND); |
return null; |
} |
- recordGetActiveNetworkInfoResult(NETWORK_INFO_UNBLOCKED); |
return networkInfo; |
} |
- /** |
- * Records the result of querying the network info of the current active network. |
- * @param result Result of querying the network info of the current active network. |
- */ |
- private static void recordGetActiveNetworkInfoResult(int result) { |
- assert result >= 0 && result < NETWORK_INFO_BOUNDARY; |
- RecordHistogram.recordEnumeratedHistogram( |
- "NCN.GetActiveNetworkInfoResult", result, NETWORK_INFO_BOUNDARY); |
- } |
- |
/** |
* Returns connection type and status information about the current |
* default network. |