Commit 4696ce58 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

Add voice interaction pending support

BUG=b:62276007
TEST=locally build and flash, start voice interaction before arc ready

Change-Id: Ie8d3489f2d4f7b08830dbf7b384e67d0dfab537b
Reviewed-on: https://chromium-review.googlesource.com/575524
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487565}
parent 79c98dd4
...@@ -234,6 +234,11 @@ void ArcVoiceInteractionFrameworkService::OnInstanceReady() { ...@@ -234,6 +234,11 @@ void ArcVoiceInteractionFrameworkService::OnInstanceReady() {
ash::Shell::Get()->accelerator_controller()->Register( ash::Shell::Get()->accelerator_controller()->Register(
{ui::Accelerator(ui::VKEY_A, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN)}, {ui::Accelerator(ui::VKEY_A, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN)},
this); this);
if (is_request_pending_) {
is_request_pending_ = false;
framework_instance->StartVoiceInteractionSession();
}
} }
void ArcVoiceInteractionFrameworkService::OnInstanceClosed() { void ArcVoiceInteractionFrameworkService::OnInstanceClosed() {
...@@ -444,6 +449,7 @@ void ArcVoiceInteractionFrameworkService::StartSessionFromUserInteraction( ...@@ -444,6 +449,7 @@ void ArcVoiceInteractionFrameworkService::StartSessionFromUserInteraction(
if (!arc_bridge_service_->voice_interaction_framework()->has_instance()) { if (!arc_bridge_service_->voice_interaction_framework()->has_instance()) {
SetArcCpuRestriction(false); SetArcCpuRestriction(false);
is_request_pending_ = true;
return; return;
} }
......
...@@ -115,6 +115,9 @@ class ArcVoiceInteractionFrameworkService ...@@ -115,6 +115,9 @@ class ArcVoiceInteractionFrameworkService
base::Closure metalayer_closed_callback_; base::Closure metalayer_closed_callback_;
bool metalayer_enabled_ = false; bool metalayer_enabled_ = false;
// Whether there is a pending request to start voice interaction.
bool is_request_pending_ = false;
// The time when a user initated an interaction. // The time when a user initated an interaction.
base::TimeTicks user_interaction_start_time_; base::TimeTicks user_interaction_start_time_;
......
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