Commit 52b34b03 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Update logic for launching vocie enrollment flow

If activity control consent has not been accepted, launch the Assistant
opt-in flow instead of voice enrollment flow.

Bug: None
Test: Manual Test
Change-Id: I3960715e17422b11c073942575c96557c2747112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1500849Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638015}
parent 463b4aca
......@@ -102,8 +102,18 @@ void AssistantController::OpenAssistantSettings() {
}
void AssistantController::StartSpeakerIdEnrollmentFlow() {
setup_controller()->StartOnboarding(false /* relaunch */,
mojom::FlowType::SPEAKER_ID_ENROLLMENT);
mojom::ConsentStatus consent_status =
Shell::Get()->voice_interaction_controller()->consent_status().value_or(
mojom::ConsentStatus::kUnknown);
if (consent_status == mojom::ConsentStatus::kActivityControlAccepted) {
// If activity control has been accepted, launch the enrollment flow.
setup_controller()->StartOnboarding(false /* relaunch */,
mojom::FlowType::SPEAKER_ID_ENROLLMENT);
} else {
// If activity control has not been accepted, launch the opt-in flow.
setup_controller()->StartOnboarding(false /* relaunch */,
mojom::FlowType::CONSENT_FLOW);
}
}
void AssistantController::DownloadImage(
......
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