Commit ba4810e3 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Prevent kiosk launch if OOBE is not completed

Bug: 854101
TBR: alemate@chromium.org
Change-Id: If980f6b3e45fd7f35378e197a2781d9ce033b28c
Reviewed-on: https://chromium-review.googlesource.com/c/1251536
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596891}
parent beae6e4c
......@@ -419,6 +419,7 @@ class AutoLaunchedKioskTest : public extensions::ExtensionApiTest {
.Set("PublicAccounts",
extensions::ListBuilder().Append(GetTestAppUserId()).Build())
.Build();
local_state->SetKey(prefs::kOobeComplete, base::Value(true));
JSONFileValueSerializer serializer(
user_data_path.Append(chrome::kLocalStateFilename));
......
......@@ -26,6 +26,7 @@
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/policy/app_install_event_log_manager_wrapper.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
......@@ -63,7 +64,11 @@ bool ShouldAutoLaunchKioskApp(const base::CommandLine& command_line) {
return command_line.HasSwitch(switches::kLoginManager) &&
!command_line.HasSwitch(switches::kForceLoginManagerInTests) &&
app_manager->IsAutoLaunchEnabled() &&
KioskAppLaunchError::Get() == KioskAppLaunchError::NONE;
KioskAppLaunchError::Get() == KioskAppLaunchError::NONE &&
// IsOobeCompleted() is needed to prevent kiosk session start in case
// of enterprise rollback, when keeping the enrollment, policy, not
// clearing TPM, but wiping stateful partition.
StartupUtils::IsOobeCompleted();
}
// Starts kiosk app auto launch and shows the splash screen.
......
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