Commit d6da668b authored by David Black's avatar David Black Committed by Commit Bot

Fix issue in which Assistant query text was dropped.

This CL makes use of the new |metadata| parameter of the
|OnInteractionStarted| event to make sure that pending query text is
not dropped due to overlapping Assistant interactions.

This CL does not fully address the issue of overlapping Assistant
interactions as calls to set the pending query text still occur outside
of the interaction lifecycle. That will be addressed as part of
b/140565663.

Bug: 973680, 941259
Change-Id: I6868387bee2b744a7573b9ed98e47077da011d04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787867Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#693944}
parent 28b2c4af
...@@ -364,7 +364,7 @@ void AssistantInteractionController::OnCommittedQueryChanged( ...@@ -364,7 +364,7 @@ void AssistantInteractionController::OnCommittedQueryChanged(
assistant::util::RecordAssistantQuerySource(assistant_query.source()); assistant::util::RecordAssistantQuerySource(assistant_query.source());
} }
// TODO(dmblack): Set pending query from |metadata| and remove calls to set // TODO(b/140565663): Set pending query from |metadata| and remove calls to set
// pending query that occur outside of this method. // pending query that occur outside of this method.
void AssistantInteractionController::OnInteractionStarted( void AssistantInteractionController::OnInteractionStarted(
AssistantInteractionMetadataPtr metadata) { AssistantInteractionMetadataPtr metadata) {
...@@ -401,15 +401,13 @@ void AssistantInteractionController::OnInteractionStarted( ...@@ -401,15 +401,13 @@ void AssistantInteractionController::OnInteractionStarted(
model_.SetPendingQuery(std::make_unique<AssistantVoiceQuery>()); model_.SetPendingQuery(std::make_unique<AssistantVoiceQuery>());
} }
} else { } else {
// TODO(b/112000321): It should not be possible to reach this code without // Once b/140565663 has been addressed to remove all calls which currently
// having previously pended a query. It does currently happen, however, in // set the pending query from outside of the interaction lifecycle, the
// the case of notifications and device action queries which bypass the // pending query type will always be |kNull| here.
// AssistantInteractionController when beginning an interaction. To address if (model_.pending_query().type() == AssistantQueryType::kNull) {
// this, we temporarily pend an empty text query to commit until we can do model_.SetPendingQuery(
// development to expose something more meaningful. std::make_unique<AssistantTextQuery>(metadata->query));
if (model_.pending_query().type() == AssistantQueryType::kNull) }
model_.SetPendingQuery(std::make_unique<AssistantTextQuery>());
model_.CommitPendingQuery(); model_.CommitPendingQuery();
model_.SetMicState(MicState::kClosed); model_.SetMicState(MicState::kClosed);
} }
......
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