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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.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: Theresa's and dfalcantara's comments with sync 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/UmaUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.java
index 6dad167052a8710a0976162c10d4193cd44ae864..9ef0d443012cd55b787d8b98a7a7aff2ee84fdca 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.java
@@ -55,6 +55,14 @@ public class UmaUtils {
}
/**
+ * Determines if this client is eligible to send metrics and crashes based on sampling. If it
+ * is, and there was user consent, then metrics and crashes would be reported
+ */
+ public static boolean isClientInMetricsReportingSample() {
+ return nativeIsClientInMetricsReportingSample();
+ }
+
+ /**
* Sets whether metrics reporting was opt-in or not. If it was opt-in, then the enable checkbox
* on first-run was default unchecked. If it was opt-out, then the checkbox was default checked.
* This should only be set once, and only during first-run.
@@ -73,5 +81,6 @@ public class UmaUtils {
return sForegroundStartTimeMs;
}
+ private static native boolean nativeIsClientInMetricsReportingSample();
private static native void nativeRecordMetricsReportingDefaultOptIn(boolean optIn);
}

Powered by Google App Engine
This is Rietveld 408576698