Skip to content

Commit bc4b8e8

Browse files
Muyuan LiCommit Bot
Muyuan Li
authored and
Commit Bot
committed
cros: Fix oobe flow for voice interaction
Correctly select voice interaction OOBE flow and runtime flow; Update launcher button state after oobe flow; BUG=b:65463229 BUG=b:65463264 TEST=local flash and test Change-Id: Ibdef7ed5b9b45894fa74c76220d7971c621abb69 Reviewed-on: https://chromium-review.googlesource.com/656577 Commit-Queue: Muyuan Li <[email protected]> Reviewed-by: Luis Hector Chavez <[email protected]> Reviewed-by: Xiyuan Xia <[email protected]> Cr-Commit-Position: refs/heads/master@{#500716}
1 parent 871ff28 commit bc4b8e8

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ void ArcVoiceInteractionFrameworkService::SetVoiceInteractionSetupCompleted() {
489489

490490
PrefService* prefs = Profile::FromBrowserContext(context_)->GetPrefs();
491491
prefs->SetBoolean(prefs::kArcVoiceInteractionValuePropAccepted, true);
492-
prefs->SetBoolean(prefs::kVoiceInteractionEnabled, true);
492+
SetVoiceInteractionEnabled(true);
493493
prefs->SetBoolean(prefs::kVoiceInteractionContextEnabled, true);
494494

495495
ash::Shell::Get()->NotifyVoiceInteractionSetupCompleted();
@@ -564,22 +564,25 @@ bool ArcVoiceInteractionFrameworkService::ValidateTimeSinceUserInteraction() {
564564
return true;
565565
}
566566

567+
void ArcVoiceInteractionFrameworkService::StartVoiceInteractionOobe() {
568+
if (chromeos::LoginDisplayHost::default_host())
569+
return;
570+
gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
571+
// The display host will be destructed at the end of OOBE flow.
572+
chromeos::LoginDisplayHostImpl* display_host =
573+
new chromeos::LoginDisplayHostImpl(screen_bounds);
574+
display_host->StartVoiceInteractionOobe();
575+
}
576+
567577
bool ArcVoiceInteractionFrameworkService::InitiateUserInteraction() {
568578
VLOG(1) << "Start voice interaction.";
569579
PrefService* prefs = Profile::FromBrowserContext(context_)->GetPrefs();
570580
if (!prefs->GetBoolean(prefs::kArcVoiceInteractionValuePropAccepted)) {
571581
VLOG(1) << "Voice interaction feature not accepted.";
572-
// If voice interaction value prop already showing, return.
573-
if (chromeos::LoginDisplayHost::default_host())
574-
return false;
582+
should_start_runtime_flow_ = true;
575583
// If voice interaction value prop has not been accepted, show the value
576584
// prop OOBE page again.
577-
gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
578-
// The display host will be destructed at the end of OOBE flow.
579-
chromeos::LoginDisplayHostImpl* display_host =
580-
new chromeos::LoginDisplayHostImpl(screen_bounds);
581-
should_start_runtime_flow_ = true;
582-
display_host->StartVoiceInteractionOobe();
585+
StartVoiceInteractionOobe();
583586
return false;
584587
}
585588

chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class ArcVoiceInteractionFrameworkService
115115
// Set voice interaction setup completed flag and notify the change.
116116
void SetVoiceInteractionSetupCompleted();
117117

118+
// Starts voice interaction OOBE flow.
119+
void StartVoiceInteractionOobe();
120+
118121
// For supporting ArcServiceManager::GetService<T>().
119122
static const char kArcServiceName[];
120123

chrome/browser/chromeos/first_run/first_run.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class DialogLauncher : public content::NotificationObserver {
140140
arc::ArcVoiceInteractionFrameworkService::GetForBrowserContext(
141141
profile_);
142142
if (service)
143-
service->StartSessionFromUserInteraction(gfx::Rect());
143+
service->StartVoiceInteractionOobe();
144144
} else {
145145
TryLaunchFirstRunDialog(profile_);
146146
}

0 commit comments

Comments
 (0)