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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java

Issue 2248243002: Enabling sampling of UMA and crash reports on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enabling sampling of UMA and crash reports on Android. Created 4 years, 4 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: chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
index 2ebed96d34158787b336c2510d21812985576498..fb98c91138a7c7cab6ab93295ef88e714420b4c1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
@@ -153,7 +153,9 @@ public class UmaSessionStats implements NetworkChangeNotifier.ConnectionTypeObse
}
/**
- * Updates the state of the MetricsService to account for the user's preferences.
+ * Updates the state of the MetricsService to account for the user's preferences. Android prefs
+ * and Chrome Local State prefs for metrics reporting should be in sync before calling this
+ * function.
*/
public void updateMetricsServiceState() {
boolean mayRecordStats = !PrivacyPreferencesManager.getInstance()
@@ -192,6 +194,9 @@ public class UmaSessionStats implements NetworkChangeNotifier.ConnectionTypeObse
prefManager.setUsageAndCrashReporting(prefBridge.isMetricsReportingEnabled());
}
+ // Update the metrics sampling state.
Alexei Svitkine (slow) 2016/08/18 06:16:39 Expand comment to mention why this is being done -
jwd 2016/08/23 18:40:03 Done.
+ prefManager.setClientInMetricsSample(UmaUtils.isClientInSample());
+
// Make sure preferences are in sync.
prefManager.syncUsageAndCrashReportingPrefs();
}

Powered by Google App Engine
This is Rietveld 408576698