Commit 42e8c7ca authored by Yue Li's avatar Yue Li Committed by Commit Bot

Update VoiceInteraction related legacy code names

Update legacy code names and comments to use 'Assistant'.
Remove obsolete logics.

Bug: b/140823590
Test: Run existing tests
Change-Id: Ie5647e85b0030c2cddfa1dfeab86c752ab6148f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808091Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697020}
parent fa4f1bf6
...@@ -118,8 +118,8 @@ using base::UserMetricsAction; ...@@ -118,8 +118,8 @@ using base::UserMetricsAction;
using message_center::Notification; using message_center::Notification;
using message_center::SystemNotificationWarningLevel; using message_center::SystemNotificationWarningLevel;
// Toast id and duration for voice interaction shortcuts // Toast id and duration for Assistant shortcuts.
constexpr char kVoiceInteractionErrorToastId[] = "voice_interaction_error"; constexpr char kAssistantErrorToastId[] = "assistant_error";
const char kFeatureDisabledByPolicyToastId[] = "disabled_by_policy_error"; const char kFeatureDisabledByPolicyToastId[] = "disabled_by_policy_error";
constexpr int kToastDurationMs = 2500; constexpr int kToastDurationMs = 2500;
...@@ -806,7 +806,7 @@ void HandleToggleAmbientMode(const ui::Accelerator& accelerator) { ...@@ -806,7 +806,7 @@ void HandleToggleAmbientMode(const ui::Accelerator& accelerator) {
Shell::Get()->ambient_controller()->Toggle(); Shell::Get()->ambient_controller()->Toggle();
} }
void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) { void HandleToggleAssistant(const ui::Accelerator& accelerator) {
if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_SPACE) { if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_SPACE) {
base::RecordAction( base::RecordAction(
base::UserMetricsAction("VoiceInteraction.Started.Search_Space")); base::UserMetricsAction("VoiceInteraction.Started.Search_Space"));
...@@ -826,51 +826,50 @@ void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) { ...@@ -826,51 +826,50 @@ void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) {
mojom::AssistantAllowedState::ALLOWED)) { mojom::AssistantAllowedState::ALLOWED)) {
case mojom::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER: case mojom::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER:
// Show a toast if the active user is not primary. // Show a toast if the active user is not primary.
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_SECONDARY_USER_TOAST_MESSAGE)); IDS_ASH_ASSISTANT_SECONDARY_USER_TOAST_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_LOCALE: case mojom::AssistantAllowedState::DISALLOWED_BY_LOCALE:
// Show a toast if voice interaction is disabled due to unsupported // Show a toast if the Assistant is disabled due to unsupported
// locales. // locales.
ShowToast( ShowToast(kAssistantErrorToastId,
kVoiceInteractionErrorToastId, l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16( IDS_ASH_ASSISTANT_LOCALE_UNSUPPORTED_TOAST_MESSAGE));
IDS_ASH_VOICE_INTERACTION_LOCALE_UNSUPPORTED_TOAST_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_POLICY: case mojom::AssistantAllowedState::DISALLOWED_BY_POLICY:
// Show a toast if voice interaction is disabled due to enterprise policy. // Show a toast if the Assistant is disabled due to enterprise policy.
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_DISABLED_BY_POLICY_MESSAGE)); IDS_ASH_ASSISTANT_DISABLED_BY_POLICY_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_DEMO_MODE: case mojom::AssistantAllowedState::DISALLOWED_BY_DEMO_MODE:
// Show a toast if voice interaction is disabled due to being in Demo // Show a toast if the Assistant is disabled due to being in Demo
// Mode. // Mode.
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_DISABLED_IN_DEMO_MODE_MESSAGE)); IDS_ASH_ASSISTANT_DISABLED_IN_DEMO_MODE_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_PUBLIC_SESSION: case mojom::AssistantAllowedState::DISALLOWED_BY_PUBLIC_SESSION:
// Show a toast if voice interaction is disabled due to being in Demo // Show a toast if the Assistant is disabled due to being in public
// Mode. // session.
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_DISABLED_IN_DEMO_MODE_MESSAGE)); IDS_ASH_ASSISTANT_DISABLED_IN_PUBLIC_SESSION_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER: case mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER:
// supervised user is deprecated, wait for the code clean up. // supervised user is deprecated, wait for the code clean up.
NOTREACHED(); NOTREACHED();
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_INCOGNITO: case mojom::AssistantAllowedState::DISALLOWED_BY_INCOGNITO:
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_DISABLED_IN_GUEST_MESSAGE)); IDS_ASH_ASSISTANT_DISABLED_IN_GUEST_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_ACCOUNT_TYPE: case mojom::AssistantAllowedState::DISALLOWED_BY_ACCOUNT_TYPE:
ShowToast(kVoiceInteractionErrorToastId, ShowToast(kAssistantErrorToastId,
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_ASH_VOICE_INTERACTION_DISABLED_BY_ACCOUNT_MESSAGE)); IDS_ASH_ASSISTANT_DISABLED_BY_ACCOUNT_MESSAGE));
return; return;
case mojom::AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE: case mojom::AssistantAllowedState::DISALLOWED_BY_KIOSK_MODE:
// No need to show toast in KIOSK mode. // No need to show toast in KIOSK mode.
...@@ -1568,7 +1567,7 @@ bool AcceleratorControllerImpl::CanPerformAction( ...@@ -1568,7 +1567,7 @@ bool AcceleratorControllerImpl::CanPerformAction(
return CanHandleShowStylusTools(); return CanHandleShowStylusTools();
case START_AMBIENT_MODE: case START_AMBIENT_MODE:
return CanHandleStartAmbientMode(); return CanHandleStartAmbientMode();
case START_VOICE_INTERACTION: case START_ASSISTANT:
return true; return true;
case SWAP_PRIMARY_DISPLAY: case SWAP_PRIMARY_DISPLAY:
return display::Screen::GetScreen()->GetNumDisplays() > 1; return display::Screen::GetScreen()->GetNumDisplays() > 1;
...@@ -1903,8 +1902,8 @@ void AcceleratorControllerImpl::PerformAction( ...@@ -1903,8 +1902,8 @@ void AcceleratorControllerImpl::PerformAction(
case START_AMBIENT_MODE: case START_AMBIENT_MODE:
HandleToggleAmbientMode(accelerator); HandleToggleAmbientMode(accelerator);
break; break;
case START_VOICE_INTERACTION: case START_ASSISTANT:
HandleToggleVoiceInteraction(accelerator); HandleToggleAssistant(accelerator);
break; break;
case SUSPEND: case SUSPEND:
HandleSuspend(); HandleSuspend();
......
...@@ -689,25 +689,25 @@ This file contains the strings for ash. ...@@ -689,25 +689,25 @@ This file contains the strings for ash.
<message name="IDS_ASH_PALETTE_SETTINGS" desc="The label on the setting button used to open palette setting page."> <message name="IDS_ASH_PALETTE_SETTINGS" desc="The label on the setting button used to open palette setting page.">
Stylus settings Stylus settings
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_LOCALE_UNSUPPORTED_TOAST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the locale is unsupported."> <message name="IDS_ASH_ASSISTANT_LOCALE_UNSUPPORTED_TOAST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the locale is unsupported.">
The Google Assistant doesn’t speak this language. The Google Assistant doesn’t speak this language.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_SECONDARY_USER_TOAST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the active user profile is not the primary user profile."> <message name="IDS_ASH_ASSISTANT_SECONDARY_USER_TOAST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the active user profile is not the primary user profile.">
The Google Assistant is only available for primary profile. The Google Assistant is only available for primary profile.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_DISABLED_BY_POLICY_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the feature is disabled by enterprise policy."> <message name="IDS_ASH_ASSISTANT_DISABLED_BY_POLICY_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but the feature is disabled by enterprise policy.">
The Google Assistant is disabled by your administrator. The Google Assistant is disabled by your administrator.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_DISABLED_IN_DEMO_MODE_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a demo session, which does not support voice interaction."> <message name="IDS_ASH_ASSISTANT_DISABLED_IN_DEMO_MODE_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a demo session, which does not support voice interaction.">
The Google Assistant is not available in a demo session. The Google Assistant is not available in a demo session.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_DISABLED_IN_PUBLIC_SESSION_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a public session, which does not support voice interaction."> <message name="IDS_ASH_ASSISTANT_DISABLED_IN_PUBLIC_SESSION_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a public session, which does not support voice interaction.">
The Google Assistant is not available in a public session. The Google Assistant is not available in a public session.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_DISABLED_IN_GUEST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a guest session, which does not support voice interaction."> <message name="IDS_ASH_ASSISTANT_DISABLED_IN_GUEST_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed in a guest session, which does not support voice interaction.">
The Google Assistant is not available in a guest session. The Google Assistant is not available in a guest session.
</message> </message>
<message name="IDS_ASH_VOICE_INTERACTION_DISABLED_BY_ACCOUNT_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but current logged in user account does not support voice interaction."> <message name="IDS_ASH_ASSISTANT_DISABLED_BY_ACCOUNT_MESSAGE" desc="Message content on the toast that appears when the voice interaction shortcut is pressed but current logged in user account does not support voice interaction.">
The Google Assistant is not available for current user account. The Google Assistant is not available for current user account.
</message> </message>
......
...@@ -177,9 +177,9 @@ const AcceleratorData kAcceleratorData[] = { ...@@ -177,9 +177,9 @@ const AcceleratorData kAcceleratorData[] = {
{true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE}, {true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE},
{true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK}, {true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK},
// Voice Interaction shortcuts. // Assistant shortcuts.
{true, ui::VKEY_A, ui::EF_COMMAND_DOWN, START_VOICE_INTERACTION}, {true, ui::VKEY_A, ui::EF_COMMAND_DOWN, START_ASSISTANT},
{true, ui::VKEY_ASSISTANT, ui::EF_NONE, START_VOICE_INTERACTION}, {true, ui::VKEY_ASSISTANT, ui::EF_NONE, START_ASSISTANT},
// IME mode change key. // IME mode change key.
{true, ui::VKEY_MODECHANGE, ui::EF_NONE, SWITCH_TO_NEXT_IME}, {true, ui::VKEY_MODECHANGE, ui::EF_NONE, SWITCH_TO_NEXT_IME},
......
...@@ -78,7 +78,7 @@ enum AcceleratorAction { ...@@ -78,7 +78,7 @@ enum AcceleratorAction {
SHOW_STYLUS_TOOLS, SHOW_STYLUS_TOOLS,
SHOW_TASK_MANAGER, SHOW_TASK_MANAGER,
START_AMBIENT_MODE, START_AMBIENT_MODE,
START_VOICE_INTERACTION, START_ASSISTANT,
SUSPEND, SUSPEND,
SWAP_PRIMARY_DISPLAY, SWAP_PRIMARY_DISPLAY,
SWITCH_IME, // Switch to another IME depending on the accelerator. SWITCH_IME, // Switch to another IME depending on the accelerator.
......
...@@ -177,7 +177,7 @@ TEST_F(HomeButtonTest, LongPressGesture) { ...@@ -177,7 +177,7 @@ TEST_F(HomeButtonTest, LongPressGesture) {
// Simulate two user with primary user as active. // Simulate two user with primary user as active.
CreateUserSessions(2); CreateUserSessions(2);
// Enable voice interaction in system settings. // Enable the Assistant in system settings.
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true);
assistant_state()->NotifyFeatureAllowed( assistant_state()->NotifyFeatureAllowed(
mojom::AssistantAllowedState::ALLOWED); mojom::AssistantAllowedState::ALLOWED);
...@@ -210,13 +210,13 @@ TEST_F(HomeButtonTest, LongPressGestureWithSecondaryUser) { ...@@ -210,13 +210,13 @@ TEST_F(HomeButtonTest, LongPressGestureWithSecondaryUser) {
assistant_state()->NotifyFeatureAllowed( assistant_state()->NotifyFeatureAllowed(
mojom::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER); mojom::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER);
// Enable voice interaction in system settings. // Enable the Assistant in system settings.
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true);
ui::GestureEvent long_press = ui::GestureEvent long_press =
CreateGestureEvent(ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); CreateGestureEvent(ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
SendGestureEvent(&long_press); SendGestureEvent(&long_press);
// Voice interaction is disabled for secondary user. // The Assistant is disabled for secondary user.
EXPECT_NE(AssistantVisibility::kVisible, Shell::Get() EXPECT_NE(AssistantVisibility::kVisible, Shell::Get()
->assistant_controller() ->assistant_controller()
->ui_controller() ->ui_controller()
...@@ -236,8 +236,8 @@ TEST_F(HomeButtonTest, LongPressGestureWithSettingsDisabled) { ...@@ -236,8 +236,8 @@ TEST_F(HomeButtonTest, LongPressGestureWithSettingsDisabled) {
// Simulate two user with primary user as active. // Simulate two user with primary user as active.
CreateUserSessions(2); CreateUserSessions(2);
// Simulate a user who has already completed setup flow, but disabled voice // Simulate a user who has already completed setup flow, but disabled the
// interaction in settings. // Assistant in settings.
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, false); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, false);
assistant_state()->NotifyFeatureAllowed( assistant_state()->NotifyFeatureAllowed(
mojom::AssistantAllowedState::ALLOWED); mojom::AssistantAllowedState::ALLOWED);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
namespace ash { namespace ash {
// A palette tool that lets the user select a screen region to be passed // A palette tool that lets the user select a screen region to be passed
// to the voice interaction framework. // to the Assistant framework.
// //
// Unlike other palette tools, it can be activated not only through the stylus // Unlike other palette tools, it can be activated not only through the stylus
// menu, but also by the stylus button click. // menu, but also by the stylus button click.
......
...@@ -68,7 +68,7 @@ class MetalayerToolTest : public AshTestBase { ...@@ -68,7 +68,7 @@ class MetalayerToolTest : public AshTestBase {
} // namespace } // namespace
// The metalayer tool is always visible, but only enabled when the user // The metalayer tool is always visible, but only enabled when the user
// has enabled the metalayer AND the voice interaction framework is ready. // has enabled the metalayer AND the Assistant framework is ready.
TEST_F(MetalayerToolTest, PaletteMenuState) { TEST_F(MetalayerToolTest, PaletteMenuState) {
const mojom::AssistantState kStates[] = {mojom::AssistantState::NOT_READY, const mojom::AssistantState kStates[] = {mojom::AssistantState::NOT_READY,
mojom::AssistantState::READY}; mojom::AssistantState::READY};
......
...@@ -3068,31 +3068,25 @@ ...@@ -3068,31 +3068,25 @@
<message name="IDS_ARC_USB_ACCESS_PERMISSION_HEADING" desc="Heading text in the content area of the Android app USB device access permission prompt. Tells the user the app will be able to access the usb device if confirmed."> <message name="IDS_ARC_USB_ACCESS_PERMISSION_HEADING" desc="Heading text in the content area of the Android app USB device access permission prompt. Tells the user the app will be able to access the usb device if confirmed.">
Allow "<ph name="APP_NAME">$1<ex>Gmail Checker</ex></ph>" to access: Allow "<ph name="APP_NAME">$1<ex>Gmail Checker</ex></ph>" to access:
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_LOADING" desc="Loading message of the voice interaction value prop dialog."> <message name="IDS_ASSISTANT_VALUE_PROP_LOADING" desc="Loading message of the voice interaction value prop dialog.">
Loading Google Assistant... Loading Google Assistant...
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_TITLE" desc="Load error title of the voice interaction value prop dialog."> <message name="IDS_ASSISTANT_VALUE_PROP_LOAD_ERROR_TITLE" desc="Load error title of the voice interaction value prop dialog.">
Google Assistant Google Assistant
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_MESSAGE" desc="Load error message of the voice interaction value prop dialog."> <message name="IDS_ASSISTANT_VALUE_PROP_LOAD_ERROR_MESSAGE" desc="Load error message of the voice interaction value prop dialog.">
Google Assistant was unable to load, please check your network connection and retry. Google Assistant was unable to load, please check your network connection and retry.
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_SKIP_BUTTON" desc="Button label for skipping voice interaction value prop upon error."> <message name="IDS_ASSISTANT_VALUE_PROP_SKIP_BUTTON" desc="Button label for skipping voice interaction value prop upon error.">
Skip Skip
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON" desc="Button label for retry loading voice interaction value prop."> <message name="IDS_ASSISTANT_VALUE_PROP_RETRY_BUTTON" desc="Button label for retry loading voice interaction value prop.">
Retry Retry
</message> </message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_NEXT_BUTTION" desc="Button label for accepting voice interaction value proposition.">
Next
</message>
<message name="IDS_WAIT_FOR_CONTAINER_READY_TITLE" desc="Title of the wait for container ready OOBE screen.">
Just a sec
</message>
<message name="IDS_WAIT_FOR_CONTAINER_READY_INTRO_MESSAGE" desc="Introduction message for the wait for container ready OOBE screen"> <message name="IDS_WAIT_FOR_CONTAINER_READY_INTRO_MESSAGE" desc="Introduction message for the wait for container ready OOBE screen">
Ask it questions. Tell it to do things. It's your personal Google, always ready to help. Ask it questions. Tell it to do things. It's your personal Google, always ready to help.
</message> </message>
<message name="IDS_VOICE_INTERACTION_LOGO" desc="Logo label for voice interaction."> <message name="IDS_ASSISTANT_LOGO" desc="Logo label for voice interaction.">
Google assistant logo Google assistant logo
</message> </message>
<message name="IDS_ASSISTANT_SCREEN_CONTEXT_TITLE" desc="Title for assistant screen context optin. This is also used as the title for a toggle that lets the assistant use whats on the screen in Assistant settings page."> <message name="IDS_ASSISTANT_SCREEN_CONTEXT_TITLE" desc="Title for assistant screen context optin. This is also used as the title for a toggle that lets the assistant use whats on the screen in Assistant settings page.">
......
...@@ -1661,17 +1661,11 @@ AutotestPrivateSetAssistantEnabledFunction::Run() { ...@@ -1661,17 +1661,11 @@ AutotestPrivateSetAssistantEnabledFunction::Run() {
if (!err_msg.empty()) if (!err_msg.empty())
return RespondNow(Error(err_msg)); return RespondNow(Error(err_msg));
// There are three possible states for the voice interaction:
// |NOT_READY| means service not running; // |NOT_READY| means service not running;
// |STOPPED| means service running but UI not shown; // |STOPPED| means service running;
// |RUNNING| means service running with UI shown on screen. auto new_state = params->enabled ? ash::mojom::AssistantState::READY
// When enabling Assistant, either |STOPPED| or |RUNNING| state could be : ash::mojom::AssistantState::NOT_READY;
// possible depending on whether the UI has been brought up. if (ash::AssistantState::Get()->assistant_state() == new_state)
auto current_state = ash::AssistantState::Get()->assistant_state();
const bool not_ready =
(current_state == ash::mojom::AssistantState::NOT_READY);
const bool success = (params->enabled != not_ready);
if (success)
return RespondNow(NoArguments()); return RespondNow(NoArguments());
// Assistant service has not responded yet, set up a delayed timer to wait for // Assistant service has not responded yet, set up a delayed timer to wait for
......
...@@ -559,9 +559,8 @@ IN_PROC_BROWSER_TEST_F(AssistantOptInFlowTest, AssistantStateUpdateAfterShow) { ...@@ -559,9 +559,8 @@ IN_PROC_BROWSER_TEST_F(AssistantOptInFlowTest, AssistantStateUpdateAfterShow) {
screen_waiter.set_assert_next_screen(); screen_waiter.set_assert_next_screen();
screen_waiter.Wait(); screen_waiter.Wait();
// Value prop screen will not be sohwn until it receives assistant settings // Value prop screen will not be sohwn until it receives assistant settings
// config, which is blocked on voice interaction controller // config, which is blocked on the Assistant state becomes READY state.
// client getting out of NOT_READY state.
test::OobeJS().ExpectHiddenPath({"assistant-optin-flow-card", "value-prop"}); test::OobeJS().ExpectHiddenPath({"assistant-optin-flow-card", "value-prop"});
test::OobeJS().ExpectVisiblePath({"assistant-optin-flow-card", "loading"}); test::OobeJS().ExpectVisiblePath({"assistant-optin-flow-card", "loading"});
......
...@@ -322,9 +322,6 @@ PrefService* WizardController::local_state_for_testing_ = nullptr; ...@@ -322,9 +322,6 @@ PrefService* WizardController::local_state_for_testing_ = nullptr;
WizardController::WizardController() WizardController::WizardController()
: screen_manager_(std::make_unique<ScreenManager>()), : screen_manager_(std::make_unique<ScreenManager>()),
network_state_helper_(std::make_unique<login::NetworkStateHelper>()) { network_state_helper_(std::make_unique<login::NetworkStateHelper>()) {
// In session OOBE was initiated from voice interaction keyboard shortcuts.
is_in_session_oobe_ =
session_manager::SessionManager::Get()->IsSessionStarted();
AccessibilityManager* accessibility_manager = AccessibilityManager::Get(); AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
if (accessibility_manager) { if (accessibility_manager) {
// accessibility_manager could be null in Tests. // accessibility_manager could be null in Tests.
...@@ -1054,11 +1051,6 @@ void WizardController::OnArcTermsOfServiceScreenExit( ...@@ -1054,11 +1051,6 @@ void WizardController::OnArcTermsOfServiceScreenExit(
} }
void WizardController::OnArcTermsOfServiceSkipped() { void WizardController::OnArcTermsOfServiceSkipped() {
if (is_in_session_oobe_) {
OnOobeFlowFinished();
return;
}
// If the user finished with the PlayStore Terms of Service, advance to the // If the user finished with the PlayStore Terms of Service, advance to the
// assistant opt-in flow screen. // assistant opt-in flow screen.
ShowAssistantOptInFlowScreen(); ShowAssistantOptInFlowScreen();
...@@ -1151,13 +1143,6 @@ void WizardController::OnSupervisionTransitionScreenExit() { ...@@ -1151,13 +1143,6 @@ void WizardController::OnSupervisionTransitionScreenExit() {
} }
void WizardController::OnOobeFlowFinished() { void WizardController::OnOobeFlowFinished() {
if (is_in_session_oobe_ && current_screen_->screen_id() !=
SupervisionTransitionScreenView::kScreenId) {
GetLoginDisplayHost()->SetStatusAreaVisible(true);
GetLoginDisplayHost()->Finalize(base::OnceClosure());
return;
}
if (!time_oobe_started_.is_null()) { if (!time_oobe_started_.is_null()) {
base::TimeDelta delta = base::Time::Now() - time_oobe_started_; base::TimeDelta delta = base::Time::Now() - time_oobe_started_;
UMA_HISTOGRAM_CUSTOM_TIMES("OOBE.BootToSignInCompleted", delta, UMA_HISTOGRAM_CUSTOM_TIMES("OOBE.BootToSignInCompleted", delta,
......
...@@ -299,9 +299,6 @@ class WizardController { ...@@ -299,9 +299,6 @@ class WizardController {
// Returns false if timezone has already been resolved. // Returns false if timezone has already been resolved.
bool SetOnTimeZoneResolvedForTesting(const base::Closure& callback); bool SetOnTimeZoneResolvedForTesting(const base::Closure& callback);
// Start voice interaction setup wizard in container
void StartVoiceInteractionSetupWizard();
// Start the enrollment screen using the config from // Start the enrollment screen using the config from
// |prescribed_enrollment_config_|. If |force_interactive| is true, // |prescribed_enrollment_config_|. If |force_interactive| is true,
// the user will be presented with a manual enrollment screen requiring // the user will be presented with a manual enrollment screen requiring
...@@ -365,8 +362,6 @@ class WizardController { ...@@ -365,8 +362,6 @@ class WizardController {
bool login_screen_started_ = false; bool login_screen_started_ = false;
bool is_in_session_oobe_ = false;
// Non-owning pointer to local state used for testing. // Non-owning pointer to local state used for testing.
static PrefService* local_state_for_testing_; static PrefService* local_state_for_testing_;
......
...@@ -65,17 +65,16 @@ AssistantOptInFlowScreenHandler::~AssistantOptInFlowScreenHandler() { ...@@ -65,17 +65,16 @@ AssistantOptInFlowScreenHandler::~AssistantOptInFlowScreenHandler() {
void AssistantOptInFlowScreenHandler::DeclareLocalizedValues( void AssistantOptInFlowScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) { ::login::LocalizedValuesBuilder* builder) {
builder->Add("locale", g_browser_process->GetApplicationLocale()); builder->Add("locale", g_browser_process->GetApplicationLocale());
builder->Add("assistantLogo", IDS_VOICE_INTERACTION_LOGO); builder->Add("assistantLogo", IDS_ASSISTANT_LOGO);
builder->Add("assistantOptinLoading", builder->Add("assistantOptinLoading", IDS_ASSISTANT_VALUE_PROP_LOADING);
IDS_VOICE_INTERACTION_VALUE_PROP_LOADING);
builder->Add("assistantOptinLoadErrorTitle", builder->Add("assistantOptinLoadErrorTitle",
IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_TITLE); IDS_ASSISTANT_VALUE_PROP_LOAD_ERROR_TITLE);
builder->Add("assistantOptinLoadErrorMessage", builder->Add("assistantOptinLoadErrorMessage",
IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_MESSAGE); IDS_ASSISTANT_VALUE_PROP_LOAD_ERROR_MESSAGE);
builder->Add("assistantOptinSkipButton", builder->Add("assistantOptinSkipButton",
IDS_VOICE_INTERACTION_VALUE_PROP_SKIP_BUTTON); IDS_ASSISTANT_VALUE_PROP_SKIP_BUTTON);
builder->Add("assistantOptinRetryButton", builder->Add("assistantOptinRetryButton",
IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON); IDS_ASSISTANT_VALUE_PROP_RETRY_BUTTON);
builder->Add("assistantVoiceMatchTitle", IDS_ASSISTANT_VOICE_MATCH_TITLE); builder->Add("assistantVoiceMatchTitle", IDS_ASSISTANT_VOICE_MATCH_TITLE);
builder->Add("assistantVoiceMatchMessage", IDS_ASSISTANT_VOICE_MATCH_MESSAGE); builder->Add("assistantVoiceMatchMessage", IDS_ASSISTANT_VOICE_MATCH_MESSAGE);
builder->Add("assistantVoiceMatchNoDspMessage", builder->Add("assistantVoiceMatchNoDspMessage",
......
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