| Index: chrome/browser/android/metrics/uma_session_stats.cc
|
| diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc
|
| index 8afb9934855addc92761eb6a350c4cb55c9f8aed..be0a0ded2608b5be048b8482d6c9f6d8b02c495e 100644
|
| --- a/chrome/browser/android/metrics/uma_session_stats.cc
|
| +++ b/chrome/browser/android/metrics/uma_session_stats.cc
|
| @@ -117,6 +117,17 @@ static void UpdateMetricsServiceState(JNIEnv* env,
|
| may_record));
|
| }
|
|
|
| + // Clear the client id pref when opting out. Note: Mirrors code in
|
| + // metrics_reporting_state.cc. TODO(asvitkine): Unify.
|
| + if (!may_record) {
|
| + // Note: Clearing client id will not affect the running state (e.g. field
|
| + // trial randomization), as the pref is only read on startup.
|
| + g_browser_process->local_state()->ClearPref(
|
| + metrics::prefs::kMetricsClientID);
|
| + g_browser_process->local_state()->ClearPref(
|
| + metrics::prefs::kMetricsReportingEnabledTimestamp);
|
| + }
|
| +
|
| g_browser_process->GetMetricsServicesManager()->UpdatePermissions(
|
| may_record, may_upload);
|
| }
|
|
|