Commit 194e24f1 authored by khmel's avatar khmel Committed by Commit Bot

arc: Don't show OOBE OptIn in case ARC is forced to start.

Bug: b/69813150
Test: Manually on device. No OOBE OptIn page and ARC starts
Change-Id: I915d9d6a426e42b26e2f74decb76eadba3f32081
Reviewed-on: https://chromium-review.googlesource.com/792632
Commit-Queue: Yury Khmel <khmel@google.com>
Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520723}
parent 3f7b8987
...@@ -584,15 +584,15 @@ bool ArcSessionManager::RequestEnableImpl() { ...@@ -584,15 +584,15 @@ bool ArcSessionManager::RequestEnableImpl() {
PrefService* const prefs = profile_->GetPrefs(); PrefService* const prefs = profile_->GetPrefs();
// If it is marked that sign in has been successfully done, if ARC has been // If it is marked that sign in has been successfully done or if Play Store is
// set up to always start, then directly start ARC. // not available, then directly start ARC with skipping Play Store ToS.
// For Kiosk mode, skip ToS because it is very likely that near the device // For Kiosk mode, skip ToS because it is very likely that near the device
// there will be no one who is eligible to accept them. // there will be no one who is eligible to accept them.
// If opt-in verification is disabled, skip negotiation, too. This is for // If opt-in verification is disabled, skip negotiation, too. This is for
// testing purpose. // testing purpose.
const bool start_arc_directly = prefs->GetBoolean(prefs::kArcSignedIn) || const bool start_arc_directly =
ShouldArcAlwaysStart() || IsArcKioskMode() || prefs->GetBoolean(prefs::kArcSignedIn) || !arc::IsPlayStoreAvailable() ||
IsArcOptInVerificationDisabled(); IsArcKioskMode() || IsArcOptInVerificationDisabled();
// When ARC is blocked because of filesystem compatibility, do not proceed // When ARC is blocked because of filesystem compatibility, do not proceed
// to starting ARC nor follow further state transitions. // to starting ARC nor follow further state transitions.
......
...@@ -591,7 +591,7 @@ class ArcSessionManagerArcAlwaysStartTest : public ArcSessionManagerTest { ...@@ -591,7 +591,7 @@ class ArcSessionManagerArcAlwaysStartTest : public ArcSessionManagerTest {
ArcSessionManagerArcAlwaysStartTest() = default; ArcSessionManagerArcAlwaysStartTest() = default;
void SetUp() override { void SetUp() override {
SetArcAlwaysStartForTesting(true); SetArcAlwaysStartForTesting(false);
ArcSessionManagerTest::SetUp(); ArcSessionManagerTest::SetUp();
} }
......
...@@ -406,6 +406,10 @@ bool IsActiveDirectoryUserForProfile(const Profile* profile) { ...@@ -406,6 +406,10 @@ bool IsActiveDirectoryUserForProfile(const Profile* profile) {
} }
bool IsArcOobeOptInActive() { bool IsArcOobeOptInActive() {
// No OOBE is expected in case Play Store is not available.
if (!IsPlayStoreAvailable())
return false;
// Check if Chrome OS OOBE or OPA OptIn flow is currently showing. // Check if Chrome OS OOBE or OPA OptIn flow is currently showing.
// TODO(b/65861628): Rename the method since it is no longer accurate. // TODO(b/65861628): Rename the method since it is no longer accurate.
// Redesign the OptIn flow since there is no longer reason to have two // Redesign the OptIn flow since there is no longer reason to have two
...@@ -436,6 +440,7 @@ bool IsArcOobeOptInActive() { ...@@ -436,6 +440,7 @@ bool IsArcOobeOptInActive() {
chromeos::switches::kEnableArcOOBEOptIn)) { chromeos::switches::kEnableArcOOBEOptIn)) {
return false; return false;
} }
return true; return true;
} }
......
...@@ -881,7 +881,7 @@ void WizardController::OnVoiceInteractionValuePropSkipped() { ...@@ -881,7 +881,7 @@ void WizardController::OnVoiceInteractionValuePropSkipped() {
void WizardController::OnVoiceInteractionValuePropAccepted() { void WizardController::OnVoiceInteractionValuePropAccepted() {
const Profile* profile = ProfileManager::GetActiveUserProfile(); const Profile* profile = ProfileManager::GetActiveUserProfile();
if (is_in_session_oobe_ && !arc::IsArcPlayStoreEnabledForProfile(profile) && if (is_in_session_oobe_ && !arc::IsArcPlayStoreEnabledForProfile(profile) &&
!arc::ShouldArcAlwaysStart()) { arc::IsPlayStoreAvailable()) {
ShowArcTermsOfServiceScreen(); ShowArcTermsOfServiceScreen();
return; return;
} }
...@@ -1620,6 +1620,13 @@ bool WizardController::ShouldShowArcTerms() const { ...@@ -1620,6 +1620,13 @@ bool WizardController::ShouldShowArcTerms() const {
VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled."; VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled.";
return false; return false;
} }
if (!arc::IsPlayStoreAvailable()) {
VLOG(1) << "Skip ARC Terms of Service screen because Play Store is not "
"available on the device.";
return false;
}
if (arc::IsActiveDirectoryUserForProfile(profile)) { if (arc::IsActiveDirectoryUserForProfile(profile)) {
VLOG(1) << "Skip ARC Terms of Service screen because it does not apply to " VLOG(1) << "Skip ARC Terms of Service screen because it does not apply to "
"Active Directory users."; "Active Directory users.";
......
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