Commit 76ef8317 authored by Artem Sumaneev's avatar Artem Sumaneev Committed by Commit Bot

Fix enrollment failure due to async DeviceSettingsService task

Make EnrollmentHandlerChromeOS ignore errors from DeviceSettingsService
via DeviceCloudPolicyStoreChromeOS while enrollment is in progress and
policies are not stored yet.

Bug: 1001822
Change-Id: Id0670e4adf2baa763a2582fcdd1b679e0e2d315e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932789Reviewed-by: default avatarIgor <igorcov@chromium.org>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Commit-Queue: Artem Sumaneev <asumaneev@google.com>
Cr-Commit-Position: refs/heads/master@{#719550}
parent 63ef97f2
......@@ -407,6 +407,19 @@ void EnrollmentHandlerChromeOS::OnStoreLoaded(CloudPolicyStore* store) {
void EnrollmentHandlerChromeOS::OnStoreError(CloudPolicyStore* store) {
DCHECK_EQ(store_, store);
if (enrollment_step_ < STEP_STORE_POLICY) {
// At those steps it is not expected to have any error notifications from
// |store_| since they are not initiated by enrollment handler and stored
// policies are not in a consistent state (e.g. a late response from
// |store_| loaded at boot). So the notification is ignored.
// Notifications are only expected starting STEP_STORE_POLICY
// when OnDeviceAccountTokenStored() is called.
LOG(WARNING) << "Unexpected store error with status: " << store->status()
<< " at step: " << enrollment_step_;
return;
}
LOG(ERROR) << "Error in device policy store.";
ReportResult(EnrollmentStatus::ForStoreError(store_->status(),
store_->validation_status()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment