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

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: 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/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..fbb579c42d4a2ca132497971111804a6c1c4fb06 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. If they are, and there was user
+ * consent, then metrics and crashes would be reported.
+ */
+ public static boolean isClientInSample() {
+ return nativeIsClientInMetricsReportingSample();
Alexei Svitkine (slow) 2016/08/18 06:16:39 Please make the native* name consistent with the m
jwd 2016/08/23 18:40:03 Done.
+ }
+
+ /**
* 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