From f47f173b06e2972bb376da8ff11db3a83c21d10b Mon Sep 17 00:00:00 2001 From: Arunesh Mishra Date: Thu, 18 Feb 2016 16:16:12 -0800 Subject: Fix AlwaysOnHotwordDetector recognition event bug. Parcelables don't work well with inheritance. So changed the IRecognitionStatusCallback to have onKeyphraseDetected() and onGenericSoundTriggerDetected() for those respective events. Made corresponding changes to AlwaysOnHotwordDetector and SoundTriggerDetector. Bug: 27250528 Change-Id: Ic08a431e7cc4248c688b05c865348170246de576 --- .../com/android/test/soundtrigger/TestSoundTriggerActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/SoundTriggerTestApp/src') diff --git a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java index 95e2dcffe9c4..4770c056814c 100644 --- a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java +++ b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java @@ -204,7 +204,10 @@ public class TestSoundTriggerActivity extends Activity { UUID modelUuid = getSelectedUuid(); SoundTriggerDetector detector = getDetector(); if (detector == null) { - Log.i(TAG, "Created an instance of the SoundTriggerDetector."); + Log.i(TAG, "Created an instance of the SoundTriggerDetector for model #" + + mSelectedModelId); + postMessage("Created an instance of the SoundTriggerDetector for model #" + + mSelectedModelId); detector = mSoundTriggerUtil.createSoundTriggerDetector(modelUuid, new DetectorCallback()); setDetector(detector); @@ -213,6 +216,7 @@ public class TestSoundTriggerActivity extends Activity { if (!detector.startRecognition( SoundTriggerDetector.RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS)) { Log.e(TAG, "Fast failure attempting to start recognition."); + postMessage("Fast failure attempting to start recognition:" + mSelectedModelId); } } @@ -220,11 +224,13 @@ public class TestSoundTriggerActivity extends Activity { SoundTriggerDetector detector = getDetector(); if (detector == null) { Log.e(TAG, "Stop called on null detector."); + postMessage("Error: Stop called on null detector."); return; } postMessage("Triggering stop recognition for model: " + mSelectedModelId); if (!detector.stopRecognition()) { Log.e(TAG, "Fast failure attempting to stop recognition."); + postMessage("Fast failure attempting to stop recognition: " + mSelectedModelId); } } -- cgit v1.2.3-59-g8ed1b