Skip to content

Commit

Permalink
[Merge to M116] ChromeUserManager: Skip resetting owner id
Browse files Browse the repository at this point in the history
This CL skips ResetOwnerId on RetrieveTrustedDevicePolicies.

ResetOwnerId was not necessary, but resetting owner_id to
absl::nullopt may cause stacking StartWithLogFile call.

This is a potential fix for the bug lacros is not launching.

(cherry picked from commit 5eb0258)

Bug: 1461981
Change-Id: I7307ae1a11c2f9092e38f0169146ba2cf6b94b51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4666418
Auto-Submit: Eriko Kurimoto <elkurin@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
Reviewed-by: Denis Kuznetsov <antrim@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1166430}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4671956
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/branch-heads/5845@{#430}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
elkurin authored and Chromium LUCI CQ committed Jul 12, 2023
1 parent 9d21b22 commit 760c2e1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions chrome/browser/ash/login/users/chrome_user_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,16 @@ void ChromeUserManagerImpl::RetrieveTrustedDevicePolicies() {
return;

SetEphemeralModeConfig(EphemeralModeConfig());
ResetOwnerId();

auto trusted_values = cros_settings_->PrepareTrustedValues(
base::BindOnce(&ChromeUserManagerImpl::RetrieveTrustedDevicePolicies,
weak_factory_.GetWeakPtr()));

// Schedule a callback if device policy has not yet been verified.
if (CrosSettingsProvider::TRUSTED !=
cros_settings_->PrepareTrustedValues(
base::BindOnce(&ChromeUserManagerImpl::RetrieveTrustedDevicePolicies,
weak_factory_.GetWeakPtr()))) {
if (CrosSettingsProvider::TRUSTED != trusted_values) {
// TODO(crbug.com/1461981): Remove the log once it's fixed.
LOG(WARNING) << "Trusted values is not TRUSTED but instead: "
<< static_cast<int>(trusted_values);
return;
}

Expand All @@ -675,6 +678,10 @@ void ChromeUserManagerImpl::RetrieveTrustedDevicePolicies() {
owner_email, std::string() /* id */, AccountType::UNKNOWN);
SetOwnerId(owner_account_id);

// TODO(crbug.com/1461981): Remove the log once it's fixed.
LOG(WARNING) << "Retrived trusted device policies. Setting Owner ID to "
<< owner_account_id;

EnsureUsersLoaded();

bool changed = UpdateAndCleanUpDeviceLocalAccounts(
Expand Down

0 comments on commit 760c2e1

Please sign in to comment.