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

Unified Diff: net/base/network_change_notifier.cc

Issue 246553003: Record Mobile Operator ID in UMA report. This is Android only for now. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@operator_id
Patch Set: addressed comments. Created 6 years, 8 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') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 638964a25d29ad12016b9d20ad64cf82df7ef222..eaf95f35618936a4a357ba0f870b7dafa16c323b 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -5,6 +5,7 @@
#include "net/base/network_change_notifier.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "build/build_config.h"
@@ -14,6 +15,10 @@
#include "net/url_request/url_request.h"
#include "url/gurl.h"
+#if defined(OS_ANDROID)
+#include "net/android/network_library.h"
+#endif
+
#if defined(OS_WIN)
#include "net/base/network_change_notifier_win.h"
#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
@@ -253,6 +258,16 @@ class HistogramWatcher
if (type != NetworkChangeNotifier::CONNECTION_NONE) {
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.NetworkOnlineChange",
SinceLast(&last_network_change_));
+#if defined(OS_ANDROID)
+ std::string mcc_mnc = android::GetTelephonyNetworkOperator();
+ if (!mcc_mnc.empty()) {
+ int value = atoi(mcc_mnc.c_str());
+ if (value > 0) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("NCN.NetworkOperatorMCCMNC", value);
+ }
+ }
+#endif
+
} else {
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.NetworkOfflineChange",
SinceLast(&last_network_change_));
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698