ProfileSyncService: Only call ClearPrimaryAccount if there is one
ClearPrimaryAccount is somewhat misnamed: It doesn't actually remove the account, it only clears the sync-consented bit, so the account will change from ConsentLevel::kSync to ConsentLevel::kNotRequired. If the primary account doesn't have sync consent to begin with (i.e. it's a Sync-the-transport user), then ClearPrimaryAccount should be a no-op. However, currently it still records metrics, and it notifies identity observers (even though nothing actually changed). This CL is a quick-fix for that issue, until ClearPrimaryAccount is actually fixed/redesigned. Bug: 1155042 Change-Id: Icc711cbd8eb118fd3d1b2ff28b2f74df4d8cde65 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566947 Commit-Queue: Marc Treib <treib@chromium.org> Reviewed-by:Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#833205}
Showing
Please register or sign in to comment