Commit ab507687 authored by Mattias Nissler's avatar Mattias Nissler Committed by Commit Bot

Bypass reset screen eligibility check after reboot

Show the reset screen immediately if powerwash has previously been
requested before reboot. This addresses a case where the screen
wouldn't show because the pending TPM availability test
incorrectly turns the eligibility check negative immediately after
reboot.

BUG=chromium:780817
TEST=Reboot-to-powerwash-with-TPM-firmware-update flow works for enrolled devices

Change-Id: Ia9c56a2422c70d19dc2cccea6b5fb21c62fa510a
Reviewed-on: https://chromium-review.googlesource.com/921842Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537612}
parent f922da77
...@@ -200,35 +200,7 @@ void CoreOobeHandler::ShowTpmError() { ...@@ -200,35 +200,7 @@ void CoreOobeHandler::ShowTpmError() {
} }
void CoreOobeHandler::ShowDeviceResetScreen() { void CoreOobeHandler::ShowDeviceResetScreen() {
// Powerwash is generally not available on enterprise devices. First, check
// the common case of a correctly enrolled device.
if (g_browser_process->platform_part()
->browser_policy_connector_chromeos()
->IsEnterpriseManaged()) {
// Powerwash not allowed, except if allowed by the admin specifically for
// the purpose of installing a TPM firmware update.
tpm_firmware_update::ShouldOfferUpdateViaPowerwash(
base::Bind([](bool offer_update) {
if (offer_update) {
// Force the TPM firmware update option to be enabled.
g_browser_process->local_state()->SetBoolean(
prefs::kFactoryResetTPMFirmwareUpdateRequested, true);
LaunchResetScreen();
}
}),
base::TimeDelta());
return;
}
// Devices that are still in OOBE may be subject to forced re-enrollment (FRE)
// and thus pending for enterprise management. These should not be allowed to
// powerwash either. Note that taking consumer device ownership has the side
// effect of dropping the FRE requirement if it was previously in effect.
const AutoEnrollmentController::FRERequirement requirement =
AutoEnrollmentController::GetFRERequirement();
if (requirement != AutoEnrollmentController::EXPLICITLY_REQUIRED) {
LaunchResetScreen(); LaunchResetScreen();
}
} }
void CoreOobeHandler::ShowEnableDebuggingScreen() { void CoreOobeHandler::ShowEnableDebuggingScreen() {
...@@ -392,7 +364,35 @@ void CoreOobeHandler::HandleSkipToUpdateForTesting() { ...@@ -392,7 +364,35 @@ void CoreOobeHandler::HandleSkipToUpdateForTesting() {
} }
void CoreOobeHandler::HandleToggleResetScreen() { void CoreOobeHandler::HandleToggleResetScreen() {
ShowDeviceResetScreen(); // Powerwash is generally not available on enterprise devices. First, check
// the common case of a correctly enrolled device.
if (g_browser_process->platform_part()
->browser_policy_connector_chromeos()
->IsEnterpriseManaged()) {
// Powerwash is only available if allowed by the admin specifically for the
// purpose of installing a TPM firmware update.
tpm_firmware_update::ShouldOfferUpdateViaPowerwash(
base::BindOnce([](bool offer_update) {
if (offer_update) {
// Force the TPM firmware update option to be enabled.
g_browser_process->local_state()->SetBoolean(
prefs::kFactoryResetTPMFirmwareUpdateRequested, true);
LaunchResetScreen();
}
}),
base::TimeDelta());
return;
}
// Devices that are still in OOBE may be subject to forced re-enrollment (FRE)
// and thus pending for enterprise management. These should not be allowed to
// powerwash either. Note that taking consumer device ownership has the side
// effect of dropping the FRE requirement if it was previously in effect.
const AutoEnrollmentController::FRERequirement requirement =
AutoEnrollmentController::GetFRERequirement();
if (requirement != AutoEnrollmentController::EXPLICITLY_REQUIRED) {
LaunchResetScreen();
}
} }
void CoreOobeHandler::HandleEnableDebuggingScreen() { void CoreOobeHandler::HandleEnableDebuggingScreen() {
......
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