Commit 9f53661e authored by Yue Li's avatar Yue Li Committed by Commit Bot

Update sync logic for voice match status

Only sync status at the first init to prevent unexpected corner cases.

Bug: 960509
Test: Manual Test
Change-Id: I5f21f9467f6ee39a722b665a08c6e16c25141dd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643610
Commit-Queue: Yue Li <updowndota@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666545}
parent 79e62ddd
......@@ -62,6 +62,8 @@ namespace chromeos {
namespace assistant {
namespace {
static bool is_first_init = true;
constexpr char kWiFiDeviceSettingId[] = "WIFI";
constexpr char kBluetoothDeviceSettingId[] = "BLUETOOTH";
constexpr char kVolumeLevelDeviceSettingId[] = "VOLUME_LEVEL";
......@@ -995,9 +997,15 @@ void AssistantManagerServiceImpl::PostInitAssistant(
std::move(post_init_callback).Run();
assistant_settings_manager_->UpdateServerDeviceSettings();
if (base::FeatureList::IsEnabled(assistant::features::kAssistantVoiceMatch) &&
service_->assistant_state()->hotword_enabled().value()) {
assistant_settings_manager_->SyncSpeakerIdEnrollmentStatus();
if (is_first_init) {
is_first_init = false;
// Only sync status at the first init to prevent unexpected corner cases.
// This still does not handle browser restart.
if (base::FeatureList::IsEnabled(
assistant::features::kAssistantVoiceMatch) &&
service_->assistant_state()->hotword_enabled().value()) {
assistant_settings_manager_->SyncSpeakerIdEnrollmentStatus();
}
}
if (base::FeatureList::IsEnabled(assistant::features::kAssistantAppSupport)) {
......
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