[CrOS MultiDevice] Fix DeviceReenroller by using DeviceSyncClient::Observer callbacks
The current implementation of DeviceReenroller uses the incorrect callbacks to signal when an enrollment and device sync are complete. Specifically, the ForceEnrollmentNow() and ForceSyncNow() callbacks were used instead of the DeviceSyncClient::Observer callbacks, OnEnrollmentFinished() and OnNewDevicesSynced(). Here, we use to the correct callbacks along with a more appropriate and simplified retry mechanism. Namely, the complete re-enrollment process of enrollment --> device sync --> verification is retried every 5 minutes or until success. Note: The OnEnrollmentFinished() and OnNewDevicesSynced() callbacks might be invoked due to enrollments or device syncs external to the DeviceReenroller class. Regardless of how the functions are called, the two sets of supported software features (from GCM device info and local device metadata) are compared. If they disagree, the re-enrollment process is triggered. Bug: 870770 Change-Id: If33320386cd8ce5d5639082009291b935ec6e471 Tested: Manual and unit tests Reviewed-on: https://chromium-review.googlesource.com/1228311 Commit-Queue: Josh Nohle <nohle@chromium.org> Reviewed-by:Kyle Horimoto <khorimoto@chromium.org> Reviewed-by:
Ryan Hansberry <hansberry@chromium.org> Cr-Commit-Position: refs/heads/master@{#592816}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment