| Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
| index cc67d03db34b1e97576af014bacf33add19b263c..ff6455abe9bd9ea1d5be24a951ee62fe54628df0 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
| @@ -26,6 +26,7 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
|
| static final String PREF_CRASH_DUMP_UPLOAD = "crash_dump_upload";
|
| static final String PREF_CRASH_DUMP_UPLOAD_NO_CELLULAR = "crash_dump_upload_no_cellular";
|
| static final String PREF_METRICS_REPORTING = "metrics_reporting";
|
| + private static final String PREF_METRICS_IN_SAMPLE = "metrics_in_sample";
|
| private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
|
| private static final String PREF_BANDWIDTH_OLD = "prefetch_bandwidth";
|
| private static final String PREF_BANDWIDTH_NO_CELLULAR_OLD = "prefetch_bandwidth_no_cellular";
|
| @@ -277,6 +278,24 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
|
| }
|
|
|
| /**
|
| + * Sets whether this client is eligible to send metrics. If they are, and there was user
|
| + * consent, then metrics and crashes would be reported.
|
| + */
|
| + public void setClientInMetricsSample(boolean inSample) {
|
| + mSharedPreferences.edit().putBoolean(PREF_METRICS_IN_SAMPLE, inSample).apply();
|
| + }
|
| +
|
| + /**
|
| + * Checks whether this client is eligible to send metrics. If they are, and there was user
|
| + * consent, then metrics and crashes would be reported.
|
| + *
|
| + * @returns boolean Whether client is eligible to send metrics.
|
| + */
|
| + public boolean isClientInMetricsSample() {
|
| + return mSharedPreferences.getBoolean(PREF_METRICS_IN_SAMPLE, true);
|
| + }
|
| +
|
| + /**
|
| * Sets the crash upload preference, which determines whether crash dumps will be uploaded
|
| * always, never, or only on wifi.
|
| *
|
| @@ -326,7 +345,6 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
|
|
|
| /**
|
| * Sets the initial value for whether crash stacks may be uploaded.
|
| - * This should be called only once, the first time Chrome is launched.
|
| */
|
| public void initCrashUploadPreference(boolean allowCrashUpload) {
|
| SharedPreferences.Editor ed = mSharedPreferences.edit();
|
|
|