Commit 57ef6fb6 authored by Saurabh Nijhara's avatar Saurabh Nijhara Committed by Commit Bot

Remove existing_user_controller as policy observer

Remove existing_user_controller as an observer of MinimumVersionPolicyHandler. This is because in case of OOBE flow after enterprise enrollment, the policy is fetched and if the minimum version requirement is not satisfied, then the update required screen is forced to be shown from existing user controller.
This abruptly interrupts the flow and causes the DCHECK() in the
EnterpriseEnrollmentHelperImpl::~EnterpriseEnrollmentHelperImpl() to fail.
Currently, not sure what would be the correct place to have the observer for the policy handler, but removing existing_user_controller for the time being to fix crash.

Bug: 1048607
Change-Id: I84c7cb9de91c2b3de26345119519e7ad348c12ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050486
Commit-Queue: Saurabh Nijhara <snijhara@google.com>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743516}
parent a1a437a9
......@@ -429,9 +429,6 @@ ExistingUserController::ExistingUserController()
kAccountsPrefDeviceLocalAccountAutoLoginDelay,
base::Bind(&ExistingUserController::ConfigureAutoLogin,
base::Unretained(this)));
minimum_version_policy_handler_ =
std::make_unique<policy::MinimumVersionPolicyHandler>(cros_settings_);
minimum_version_policy_handler_->AddObserver(this);
observed_user_manager_.Add(user_manager::UserManager::Get());
}
......@@ -588,27 +585,11 @@ void ExistingUserController::OnKioskAppsSettingsChanged() {
ConfigureAutoLogin();
}
////////////////////////////////////////////////////////////////////////////////
// ExistingUserController, policy::MinimumVersionPolicyHandler::Observer
// implementation:
//
void ExistingUserController::OnMinimumVersionStateChanged() {
if (is_login_in_progress_) {
// Too late, but there is another check in user session.
return;
}
if (!minimum_version_policy_handler_->RequirementsAreSatisfied()) {
ShowUpdateRequiredScreen();
}
}
////////////////////////////////////////////////////////////////////////////////
// ExistingUserController, private:
ExistingUserController::~ExistingUserController() {
UserSessionManager::GetInstance()->DelegateDeleted(this);
minimum_version_policy_handler_->RemoveObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -24,7 +24,6 @@
#include "chrome/browser/chromeos/login/screens/encryption_migration_mode.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/login/ui/login_display.h"
#include "chrome/browser/chromeos/policy/minimum_version_policy_handler.h"
#include "chrome/browser/chromeos/policy/pre_signin_policy_fetcher.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
......@@ -60,14 +59,12 @@ class NetworkStateHelper;
// ExistingUserController is used to handle login when someone has already
// logged into the machine. ExistingUserController is created and owned by
// LoginDisplayHost.
class ExistingUserController
: public LoginDisplay::Delegate,
public content::NotificationObserver,
public LoginPerformer::Delegate,
public KioskAppManagerObserver,
public UserSessionManagerDelegate,
public user_manager::UserManager::Observer,
public policy::MinimumVersionPolicyHandler::Observer {
class ExistingUserController : public LoginDisplay::Delegate,
public content::NotificationObserver,
public LoginPerformer::Delegate,
public KioskAppManagerObserver,
public UserSessionManagerDelegate,
public user_manager::UserManager::Observer {
public:
// Returns the current existing user controller fetched from the current
// LoginDisplayHost instance.
......@@ -130,9 +127,6 @@ class ExistingUserController
// KioskAppManagerObserver overrides.
void OnKioskAppsSettingsChanged() override;
// policy::MinimumVersionPolicyHandler::Observer overrides.
void OnMinimumVersionStateChanged() override;
// Set a delegate that we will pass AuthStatusConsumer events to.
// Used for testing.
void set_login_status_consumer(AuthStatusConsumer* consumer) {
......@@ -425,8 +419,6 @@ class ExistingUserController
local_account_auto_login_id_subscription_;
std::unique_ptr<CrosSettings::ObserverSubscription>
local_account_auto_login_delay_subscription_;
std::unique_ptr<policy::MinimumVersionPolicyHandler>
minimum_version_policy_handler_;
std::unique_ptr<OAuth2TokenInitializer> oauth2_token_initializer_;
......
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