Commit 58db8916 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Commit Bot

Set ODA resource dir in LibAssistant config

Without this the On-Device-Assistant will not start correctly.

Bug: b/154866551
Change-Id: I04e9202fb21746304f240a2cb4cb7cd1258ec03b
Tests: Launched Assistant and ensured ODA started
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225219Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/master@{#773747}
parent 45a8b5fb
......@@ -17,10 +17,7 @@ constexpr int kReadFileSizeLimitInBytes = 10 * 1024 * 1024;
} // namespace
FileProviderImpl::FileProviderImpl()
: root_path_(
GetRootPath().Append(FILE_PATH_LITERAL("google-assistant-library"))) {
}
FileProviderImpl::FileProviderImpl() : root_path_(GetBaseAssistantDir()) {}
FileProviderImpl::~FileProviderImpl() = default;
......
......@@ -51,6 +51,10 @@ base::FilePath GetRootPath() {
return home_dir;
}
base::FilePath GetBaseAssistantDir() {
return GetRootPath().Append(FILE_PATH_LITERAL("google-assistant-library"));
}
std::string CreateLibAssistantConfig(
base::Optional<std::string> s3_server_uri_override) {
using Value = base::Value;
......@@ -138,6 +142,11 @@ std::string CreateLibAssistantConfig(
config.SetKey("audio_input", std::move(audio_input));
if (features::IsOnDeviceAssistantEnabled()) {
config.SetStringPath("internal.base_oda_resources_dir",
GetBaseAssistantDir().AsUTF8Unsafe());
}
// Use http unless we're using the fake s3 server, which requires grpc.
if (s3_server_uri_override)
config.SetStringPath("internal.transport_type", "GRPC");
......
......@@ -17,8 +17,12 @@ class FilePath;
namespace chromeos {
namespace assistant {
// Returns the root path of all user specific files.
base::FilePath GetRootPath();
// Returns the path where all downloaded LibAssistant resources are stored.
base::FilePath GetBaseAssistantDir();
// Creates the configuration for libassistant.
std::string CreateLibAssistantConfig(
base::Optional<std::string> s3_server_uri_override = base::nullopt);
......
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