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

Unified Diff: net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java

Issue 2873133004: Revert histograms for crbug.com/677365 as they're no longer needed. (Closed)
Patch Set: deprecate histograms Created 3 years, 7 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698