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

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

Issue 2872353003: Remove histograms for system IPCs returning NPEs. (Closed)
Patch Set: sync 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 014871777a2afbbbc62c655bb6250065e7ca3dad..b1f29fb2f25ac8c694cc6b74aaab570e8d1b6c00 100644
--- a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
+++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
@@ -35,7 +35,6 @@ import org.chromium.base.ApplicationStatus;
import org.chromium.base.BuildConfig;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
-import org.chromium.base.metrics.RecordHistogram;
import java.io.IOException;
import java.util.Arrays;
@@ -161,19 +160,12 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver {
// Fetches NetworkInfo and records UMA for NullPointerExceptions.
private NetworkInfo getNetworkInfo(Network network) {
try {
- NetworkInfo networkInfo = mConnectivityManager.getNetworkInfo(network);
- RecordHistogram.recordBooleanHistogram("NCN.getNetInfo1stSuccess", true);
- return networkInfo;
+ return mConnectivityManager.getNetworkInfo(network);
} catch (NullPointerException firstException) {
- RecordHistogram.recordBooleanHistogram("NCN.getNetInfo1stSuccess", false);
- // Try the IPC again to test if the NPE is a random/transient/ephemeral failure.
- // This will indicate if retrying is a viable solution.
+ // Rarely this unexpectedly throws. Retry or just return {@code null} if it fails.
try {
- NetworkInfo networkInfo = mConnectivityManager.getNetworkInfo(network);
- RecordHistogram.recordBooleanHistogram("NCN.getNetInfo2ndSuccess", true);
- return networkInfo;
+ return mConnectivityManager.getNetworkInfo(network);
} catch (NullPointerException secondException) {
- RecordHistogram.recordBooleanHistogram("NCN.getNetInfo2ndSuccess", false);
return null;
}
}
@@ -364,19 +356,12 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver {
@GuardedBy("mLock")
private WifiInfo getWifiInfoLocked() {
try {
- WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
- RecordHistogram.recordBooleanHistogram("NCN.getWifiInfo1stSuccess", true);
- return wifiInfo;
+ return mWifiManager.getConnectionInfo();
} catch (NullPointerException firstException) {
- RecordHistogram.recordBooleanHistogram("NCN.getWifiInfo1stSuccess", false);
- // Try the IPC again to test if the NPE is a random/transient/ephemeral failure.
- // This will indicate if retrying is a viable solution.
+ // Rarely this unexpectedly throws. Retry or just return {@code null} if it fails.
try {
- WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
- RecordHistogram.recordBooleanHistogram("NCN.getWifiInfo2ndSuccess", true);
- return wifiInfo;
+ return mWifiManager.getConnectionInfo();
} catch (NullPointerException secondException) {
- RecordHistogram.recordBooleanHistogram("NCN.getWifiInfo2ndSuccess", false);
return null;
}
}
« 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