| 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 4b8c6ab581ea6efee6e95f0cde7e4c6d02eaa7a5..6c9272b14f6ccf7330fcbde2f9ace0877ab21c8b 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);
|
| }
|
|
|