Commit 792cef16 authored by amistry's avatar amistry Committed by Commit bot

With always-on enabled, always shut down the hotword detector after a trigger.

This is because the hotword stream requires that it be closed and
re-opened after triggering and currently, the only way to do this is to
shutdown the detector since its stream cannot be replaced.

BUG=403138

Review URL: https://codereview.chromium.org/940833002

Cr-Commit-Position: refs/heads/master@{#317023}
parent 9a920cc1
......@@ -216,7 +216,8 @@ cr.define('hotword', function() {
*/
isAlwaysOnEnabled: function() {
assert(this.hotwordStatus_, 'No hotword status (isAlwaysOnEnabled)');
return this.hotwordStatus_.alwaysOnEnabled;
return this.hotwordStatus_.alwaysOnEnabled &&
!this.hotwordStatus_.trainingEnabled;
},
/**
......@@ -485,6 +486,12 @@ cr.define('hotword', function() {
UmaTriggerSources_[session.source_],
hotword.constants.UmaTriggerSource.MAX);
}
// If we're in always-on mode, shut down the hotword detector. The hotword
// stream requires that we close and re-open it after a trigger, and the
// only way to accomplish this is to shut everything down.
if (this.isAlwaysOnEnabled())
this.shutdownDetector_();
},
/**
......
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