summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction
diff options
context:
space:
mode:
authorSandeep Siddhartha <sansid@google.com>2014-07-29 12:53:34 -0700
committerSandeep Siddhartha <sansid@google.com>2014-07-31 15:48:26 -0700
commit668327d0286591324fa7592ee9b39255076e2165 (patch)
treeafe925721cebd3edc447b1c360bb2ef95e42e77c /tests/VoiceInteraction
parent6bf8be555267c55bae6615bcd5cd6903d5e06745 (diff)
downloadframeworks_base-668327d0286591324fa7592ee9b39255076e2165.zip
frameworks_base-668327d0286591324fa7592ee9b39255076e2165.tar.gz
frameworks_base-668327d0286591324fa7592ee9b39255076e2165.tar.bz2
Tighten the checks around a detector being invalidated
Don't call back for a detector being marked invalid because that happens when someone else obtains a detector or VIS shuts down, in either case we don't want a loop where two entities keep creating new detectors and being invalidated. Don't call back on an invalid detector for availability change/detected/started and stopped only propagate errors. This helps us with cases where a callback for the previous VIS may get called and then crash because it tries to make calls without being the current VIS. In the new scheme of things, if the VIS changes, or the current VIS obtains a new AlwaysOnHotwordDetector, the previous one is shutdown and internally marked as invalid and all calls to it fail with an IllegalStateException. Bug: 16629417 Change-Id: I74417bf76ba80916ebc21b042c18b3467857733e
Diffstat (limited to 'tests/VoiceInteraction')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java5
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
index 49c3d0a..b43ad6f 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
@@ -81,11 +81,6 @@ public class MainInteractionService extends VoiceInteractionService {
private void hotwordAvailabilityChangeHelper(int availability) {
Log.i(TAG, "Hotword availability = " + availability);
switch (availability) {
- case AlwaysOnHotwordDetector.STATE_INVALID:
- Log.i(TAG, "STATE_INVALID");
- mHotwordDetector =
- createAlwaysOnHotwordDetector("Hello There", "en-US", mHotwordCallback);
- break;
case AlwaysOnHotwordDetector.STATE_HARDWARE_UNAVAILABLE:
Log.i(TAG, "STATE_HARDWARE_UNAVAILABLE");
break;