Commit 09b735ff authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Restore skipping update via OOBE configuration

Existing approach did not work on official builds (because skipping
update is not supported on them).

Test: OobeConfigurationEnrollmentTest.*, with check that removing
"updateSkipNonCritical" from sample configuration breaks tests.

Bug: 854101
Change-Id: Ic8e598bec9297f5f6e3333abb42a5b2b0018df78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619810Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661369}
parent 7a27a76f
......@@ -71,6 +71,8 @@ const char kArcTosAutoAccept[] = "arcTosAutoAccept";
// == Update screen:
// Boolean value, indicating that all non-critical updates should be skipped.
// This should be used only during rollback scenario, when Chrome version is
// known not to have any critical issues.
const char kUpdateSkipUpdate[] = "updateSkipNonCritical";
// == Wizard controller:
......@@ -128,7 +130,7 @@ constexpr struct {
ConfigurationHandlerSide::HANDLER_JS},
{kEULAAutoAccept, ValueType::BOOLEAN, ConfigurationHandlerSide::HANDLER_JS},
{kUpdateSkipUpdate, ValueType::BOOLEAN,
ConfigurationHandlerSide::HANDLER_JS},
ConfigurationHandlerSide::HANDLER_CPP},
{kWizardAutoEnroll, ValueType::BOOLEAN,
ConfigurationHandlerSide::HANDLER_CPP},
{kRestoreAfterRollback, ValueType::BOOLEAN,
......
......@@ -1222,6 +1222,16 @@ void WizardController::InitiateOOBEUpdate() {
return;
}
const auto* skip_screen_key = oobe_configuration_.FindKeyOfType(
configuration::kUpdateSkipUpdate, base::Value::Type::BOOLEAN);
const bool skip_screen = skip_screen_key && skip_screen_key->GetBool();
if (skip_screen) {
VLOG(1) << "Skip OOBE Update because of configuration.";
OnUpdateCompleted();
return;
}
// If this is a Cellular First device, instruct UpdateEngine to allow
// updates over cellular data connections.
if (chromeos::switches::IsCellularFirstDevice()) {
......
......@@ -24,12 +24,6 @@ login.createScreen('UpdateScreen', 'update', function() {
/** @param {boolean} enabled */
setCancelUpdateShortcutEnabled: function(enabled) {
$('oobe-update-md').cancelAllowed = enabled;
var configuration = Oobe.getInstance().getOobeConfiguration();
if (!configuration)
return;
if (configuration.updateSkipNonCritical && enabled) {
this.cancel();
}
},
/**
......
......@@ -94,7 +94,6 @@ OobeTypes.TimezoneDsc;
* eulaAutoAccept: (boolean|undefined),
* eulaSendStatistics: (boolean|undefined),
* networkUseConnected: (boolean|undefined),
* updateSkipNonCritical: (boolean|undefined),
* arcTosAutoAccept: (boolean|undefined),
* }}
*/
......
......@@ -5,4 +5,4 @@
"eulaSendStatistics": true,
"updateSkipNonCritical": true,
"wizardAutoEnroll": true
}
\ No newline at end of file
}
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