Fix DCHECK when opening Chrome OS settings for user with "." in email
Settings shows GAIA's notion of the user's email address. For example, if the user signed up for a Google account "Foo.Bar@gmail.com", they can login to their device with "foobar", but settings shows "Foo.Bar". Under the hood, the "canonical" email is "foobar", and this is used to create AccountId objects. signin_ui_util::GetAuthenticatedUsername() was trying to create an AccountId object using "Foo.Bar" as input, which caused the DCHECK. However, the function wants that AccountId to look up the original email with periods in it. Use ProfileHelper::Get()->GetUserByProfile(profile)->GetDisplayEmail() instead. This avoids AccountId construction entirely. See bug for details. Also set a "display email" for public accounts to fix tests (and possibly production). Bug: 994798 Test: settings opens correctly for "james.cook@gmail.com" Change-Id: Ia01f1d902d3439afa0f53c5535fe6097299ab916 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1757509Reviewed-by:Toni Baržić <tbarzic@chromium.org> Reviewed-by:
Alexander Alekseev <alemate@chromium.org> Reviewed-by:
Xiyuan Xia <xiyuan@chromium.org> Reviewed-by:
Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: James Cook <jamescook@chromium.org> Cr-Commit-Position: refs/heads/master@{#690106}
Showing
Please register or sign in to comment