Commit 246c27f8 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Enable voice match for opt-out mode

No longer need to hide voice match settings option.
No longer need to show opt-in flow instead of voice training flow.
Update browser tests.

browser_tests

Bug: b/132107317
Test: run OSSettingsGoogleAssistantPageTest.AllJsTests in
Change-Id: I518603672ef06f7b849532adf23581abfaeb56b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2322066Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792849}
parent 29574a2b
...@@ -93,17 +93,8 @@ void AssistantControllerImpl::SendAssistantFeedback( ...@@ -93,17 +93,8 @@ void AssistantControllerImpl::SendAssistantFeedback(
} }
void AssistantControllerImpl::StartSpeakerIdEnrollmentFlow() { void AssistantControllerImpl::StartSpeakerIdEnrollmentFlow() {
if (assistant_state_controller_.consent_status().value_or( setup_controller()->StartOnboarding(false /* relaunch */,
chromeos::assistant::prefs::ConsentStatus::kUnknown) == FlowType::kSpeakerIdEnrollment);
chromeos::assistant::prefs::ConsentStatus::kActivityControlAccepted) {
// If activity control has been accepted, launch the enrollment flow.
setup_controller()->StartOnboarding(false /* relaunch */,
FlowType::kSpeakerIdEnrollment);
} else {
// If activity control has not been accepted, launch the opt-in flow.
setup_controller()->StartOnboarding(false /* relaunch */,
FlowType::kConsentFlow);
}
} }
void AssistantControllerImpl::DownloadImage( void AssistantControllerImpl::DownloadImage(
......
...@@ -198,10 +198,7 @@ Polymer({ ...@@ -198,10 +198,7 @@ Polymer({
this.shouldShowVoiceMatchSettings_ = this.shouldShowVoiceMatchSettings_ =
!loadTimeData.getBoolean('voiceMatchDisabled') && !loadTimeData.getBoolean('voiceMatchDisabled') &&
!!this.getPref('settings.voice_interaction.hotword.enabled').value && !!this.getPref('settings.voice_interaction.hotword.enabled').value;
(this.getPref(
'settings.voice_interaction.activity_control.consent_status')
.value == ConsentStatus.kActivityControlAccepted);
const hotwordEnabled = const hotwordEnabled =
this.getPref('settings.voice_interaction.hotword.enabled'); this.getPref('settings.voice_interaction.hotword.enabled');
......
...@@ -226,35 +226,16 @@ suite('GoogleAssistantHandler', function() { ...@@ -226,35 +226,16 @@ suite('GoogleAssistantHandler', function() {
button = page.$$('#retrain-voice-model'); button = page.$$('#retrain-voice-model');
assertFalse(!!button); assertFalse(!!button);
// Hotword enabled.
// Activity control consent not granted.
// Button should not be shown.
page.setPrefValue('settings.voice_interaction.hotword.enabled', true);
page.setPrefValue(
'settings.voice_interaction.activity_control.consent_status',
ConsentStatus.kUnauthorized);
Polymer.dom.flush();
button = page.$$('#retrain-voice-model');
assertFalse(!!button);
// Hotword disabled. // Hotword disabled.
// Activity control consent granted.
// Button should not be shown. // Button should not be shown.
page.setPrefValue('settings.voice_interaction.hotword.enabled', false); page.setPrefValue('settings.voice_interaction.hotword.enabled', false);
page.setPrefValue(
'settings.voice_interaction.activity_control.consent_status',
ConsentStatus.kActivityControlAccepted);
Polymer.dom.flush(); Polymer.dom.flush();
button = page.$$('#retrain-voice-model'); button = page.$$('#retrain-voice-model');
assertFalse(!!button); assertFalse(!!button);
// Hotword enabled. // Hotword enabled.
// Activity control consent granted.
// Button should be shown. // Button should be shown.
page.setPrefValue('settings.voice_interaction.hotword.enabled', true); page.setPrefValue('settings.voice_interaction.hotword.enabled', true);
page.setPrefValue(
'settings.voice_interaction.activity_control.consent_status',
ConsentStatus.kActivityControlAccepted);
Polymer.dom.flush(); Polymer.dom.flush();
button = page.$$('#retrain-voice-model'); button = page.$$('#retrain-voice-model');
assertTrue(!!button); assertTrue(!!button);
......
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