Commit fa5ef44e authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Commit Bot

Revert "assistant: Remove IsScreenContextQueryEnabled"

This reverts commit de6ebaa2.

Reason for revert: causes compile failure on linux-chromeos-chrome

Sample build: https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/3372

Sample log: https://logs.chromium.org/logs/chrome/buildbucket/cr-buildbucket.appspot.com/8887878986181186864/+/steps/compile/0/stdout?format=raw
---
[34344/60074] CXX obj/chromeos/services/assistant/lib/assistant_manager_service_impl.o
FAILED: obj/chromeos/services/assistant/lib/assistant_manager_service_impl.o
/b/s/w/ir/cache/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF...(too long)
../../chromeos/services/assistant/assistant_manager_service_impl.cc:101:16: error: unused variable 'kScreenContextQuery' [-Werror,-Wunused-const-variable]
constexpr char kScreenContextQuery[] = "screen context";
^
1 error generated.
---

Original change's description:
> assistant: Remove IsScreenContextQueryEnabled
> 
> Remove unused code.
> 
> Bug: b/145218971
> Test: manual
> Change-Id: I54e08fc38e967517212b2f41fabe6bb872d17cf3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067938
> Commit-Queue: Tao Wu <wutao@chromium.org>
> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#743408}

TBR=xiaohuic@chromium.org,wutao@chromium.org

Change-Id: I565b31eb10ecaf53d9adae452320de420b7f00db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/145218971
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067761Reviewed-by: default avatarTakashi Sakamoto <tasak@google.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/master@{#743425}
parent d32baf4f
......@@ -1543,6 +1543,19 @@ void AssistantManagerServiceImpl::SendScreenContextRequest(
ax::mojom::AssistantExtra* assistant_extra,
ui::AssistantTree* assistant_tree,
const std::vector<uint8_t>& assistant_screenshot) {
if (assistant::features::IsScreenContextQueryEnabled()) {
assistant_client::VoicelessOptions options;
options.is_user_initiated = true;
assistant_manager_internal_->SendTextQueryWithClientDiscourseContext(
kScreenContextQuery,
CreateContextProto(
AssistantBundle{assistant_extra_.get(), assistant_tree_.get()},
assistant_screenshot),
options);
return;
}
std::vector<std::string> context_protos;
// Screen context can have the assistant_extra and assistant_tree set to
......
......@@ -98,6 +98,12 @@ const base::Feature kEnableTextQueriesWithClientDiscourseContext{
const base::Feature kEnablePowerManager{"ChromeOSAssistantEnablePowerManager",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enables sending a screen context request ("What's on my screen?" and
// metalayer selection) as a text query. This is as opposed to sending
// the request as a contextual cards request.
const base::Feature kScreenContextQuery{"ChromeOSAssistantScreenContextQuery",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kEnableMediaSessionIntegration{
"AssistantEnableMediaSessionIntegration",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -188,6 +194,10 @@ bool IsRoutinesEnabled() {
return base::FeatureList::IsEnabled(kAssistantRoutines);
}
bool IsScreenContextQueryEnabled() {
return base::FeatureList::IsEnabled(kScreenContextQuery);
}
bool IsStereoAudioInputEnabled() {
return base::FeatureList::IsEnabled(kEnableStereoAudioInput) ||
// Audio eraser requires 2 channel input.
......
......@@ -137,6 +137,8 @@ bool IsResponseProcessingV2Enabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsRoutinesEnabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsScreenContextQueryEnabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsStereoAudioInputEnabled();
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) bool IsWarmerWelcomeEnabled();
......
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