Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: chrome/browser/resources/hotword/state_manager.js

Issue 940833002: With always-on enabled, always shut down the hotword detector after a trigger. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword/state_manager.js
diff --git a/chrome/browser/resources/hotword/state_manager.js b/chrome/browser/resources/hotword/state_manager.js
index 1b94e70a2712800e1e62a6e257419b6f603b3b52..89148cade48873b24d6120fa1cb35d46dbf9d88d 100644
--- a/chrome/browser/resources/hotword/state_manager.js
+++ b/chrome/browser/resources/hotword/state_manager.js
@@ -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_();
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698