Loading core/java/android/service/voice/AlwaysOnHotwordDetector.java +10 −2 Original line number Original line Diff line number Diff line Loading @@ -354,6 +354,13 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { null); null); } } EventPayload(boolean triggerAvailable, boolean captureAvailable, AudioFormat audioFormat, int captureSession, byte[] data, HotwordDetectedResult hotwordDetectedResult) { this(triggerAvailable, captureAvailable, audioFormat, captureSession, data, hotwordDetectedResult, null); } EventPayload(AudioFormat audioFormat, HotwordDetectedResult hotwordDetectedResult) { EventPayload(AudioFormat audioFormat, HotwordDetectedResult hotwordDetectedResult) { this(false, false, audioFormat, -1, null, hotwordDetectedResult, null); this(false, false, audioFormat, -1, null, hotwordDetectedResult, null); } } Loading Loading @@ -1149,7 +1156,8 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { } } @Override @Override public void onKeyphraseDetected(KeyphraseRecognitionEvent event) { public void onKeyphraseDetected( KeyphraseRecognitionEvent event, HotwordDetectedResult result) { if (DBG) { if (DBG) { Slog.d(TAG, "onDetected(" + event + ")"); Slog.d(TAG, "onDetected(" + event + ")"); } else { } else { Loading @@ -1157,7 +1165,7 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { } } Message.obtain(mHandler, MSG_HOTWORD_DETECTED, Message.obtain(mHandler, MSG_HOTWORD_DETECTED, new EventPayload(event.triggerInData, event.captureAvailable, new EventPayload(event.triggerInData, event.captureAvailable, event.captureFormat, event.captureSession, event.data)) event.captureFormat, event.captureSession, event.data, result)) .sendToTarget(); .sendToTarget(); } } @Override @Override Loading core/java/android/service/voice/SoftwareHotwordDetector.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -147,8 +147,9 @@ class SoftwareHotwordDetector extends AbstractHotwordDetector { } } @Override @Override public void onKeyphraseDetected(SoundTrigger.KeyphraseRecognitionEvent recognitionEvent) public void onKeyphraseDetected( throws RemoteException { SoundTrigger.KeyphraseRecognitionEvent recognitionEvent, HotwordDetectedResult result) { } } Loading core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl +5 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.app; package com.android.internal.app; import android.hardware.soundtrigger.SoundTrigger; import android.hardware.soundtrigger.SoundTrigger; import android.service.voice.HotwordDetectedResult; import android.service.voice.HotwordRejectedResult; import android.service.voice.HotwordRejectedResult; /** /** Loading @@ -29,8 +30,11 @@ oneway interface IHotwordRecognitionStatusCallback { * @param recognitionEvent Object containing data relating to the * @param recognitionEvent Object containing data relating to the * keyphrase recognition event such as keyphrase * keyphrase recognition event such as keyphrase * extras. * extras. * @param result Successful detection result payload. */ */ void onKeyphraseDetected(in SoundTrigger.KeyphraseRecognitionEvent recognitionEvent); void onKeyphraseDetected( in SoundTrigger.KeyphraseRecognitionEvent recognitionEvent, in HotwordDetectedResult result); /** /** * Called when a generic sound trigger event is witnessed. * Called when a generic sound trigger event is witnessed. Loading services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java +3 −4 Original line number Original line Diff line number Diff line Loading @@ -318,7 +318,7 @@ final class HotwordDetectionConnection { if (DEBUG) { if (DEBUG) { Slog.d(TAG, "onDetected"); Slog.d(TAG, "onDetected"); } } externalCallback.onKeyphraseDetected(recognitionEvent); externalCallback.onKeyphraseDetected(recognitionEvent, result); } } @Override @Override Loading Loading @@ -351,8 +351,7 @@ final class HotwordDetectionConnection { if (DEBUG) { if (DEBUG) { Slog.d(TAG, "onDetected"); Slog.d(TAG, "onDetected"); } } // TODO: Propagate the HotwordDetectedResult. externalCallback.onKeyphraseDetected(recognitionEvent, result); externalCallback.onKeyphraseDetected(recognitionEvent); } } @Override @Override Loading Loading @@ -396,7 +395,7 @@ final class HotwordDetectionConnection { mHotwordDetectionConnection.detectFromDspSource( mHotwordDetectionConnection.detectFromDspSource( recognitionEvent, mExternalCallback); recognitionEvent, mExternalCallback); } else { } else { mExternalCallback.onKeyphraseDetected(recognitionEvent); mExternalCallback.onKeyphraseDetected(recognitionEvent, null); } } } } Loading Loading
core/java/android/service/voice/AlwaysOnHotwordDetector.java +10 −2 Original line number Original line Diff line number Diff line Loading @@ -354,6 +354,13 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { null); null); } } EventPayload(boolean triggerAvailable, boolean captureAvailable, AudioFormat audioFormat, int captureSession, byte[] data, HotwordDetectedResult hotwordDetectedResult) { this(triggerAvailable, captureAvailable, audioFormat, captureSession, data, hotwordDetectedResult, null); } EventPayload(AudioFormat audioFormat, HotwordDetectedResult hotwordDetectedResult) { EventPayload(AudioFormat audioFormat, HotwordDetectedResult hotwordDetectedResult) { this(false, false, audioFormat, -1, null, hotwordDetectedResult, null); this(false, false, audioFormat, -1, null, hotwordDetectedResult, null); } } Loading Loading @@ -1149,7 +1156,8 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { } } @Override @Override public void onKeyphraseDetected(KeyphraseRecognitionEvent event) { public void onKeyphraseDetected( KeyphraseRecognitionEvent event, HotwordDetectedResult result) { if (DBG) { if (DBG) { Slog.d(TAG, "onDetected(" + event + ")"); Slog.d(TAG, "onDetected(" + event + ")"); } else { } else { Loading @@ -1157,7 +1165,7 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { } } Message.obtain(mHandler, MSG_HOTWORD_DETECTED, Message.obtain(mHandler, MSG_HOTWORD_DETECTED, new EventPayload(event.triggerInData, event.captureAvailable, new EventPayload(event.triggerInData, event.captureAvailable, event.captureFormat, event.captureSession, event.data)) event.captureFormat, event.captureSession, event.data, result)) .sendToTarget(); .sendToTarget(); } } @Override @Override Loading
core/java/android/service/voice/SoftwareHotwordDetector.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -147,8 +147,9 @@ class SoftwareHotwordDetector extends AbstractHotwordDetector { } } @Override @Override public void onKeyphraseDetected(SoundTrigger.KeyphraseRecognitionEvent recognitionEvent) public void onKeyphraseDetected( throws RemoteException { SoundTrigger.KeyphraseRecognitionEvent recognitionEvent, HotwordDetectedResult result) { } } Loading
core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl +5 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.app; package com.android.internal.app; import android.hardware.soundtrigger.SoundTrigger; import android.hardware.soundtrigger.SoundTrigger; import android.service.voice.HotwordDetectedResult; import android.service.voice.HotwordRejectedResult; import android.service.voice.HotwordRejectedResult; /** /** Loading @@ -29,8 +30,11 @@ oneway interface IHotwordRecognitionStatusCallback { * @param recognitionEvent Object containing data relating to the * @param recognitionEvent Object containing data relating to the * keyphrase recognition event such as keyphrase * keyphrase recognition event such as keyphrase * extras. * extras. * @param result Successful detection result payload. */ */ void onKeyphraseDetected(in SoundTrigger.KeyphraseRecognitionEvent recognitionEvent); void onKeyphraseDetected( in SoundTrigger.KeyphraseRecognitionEvent recognitionEvent, in HotwordDetectedResult result); /** /** * Called when a generic sound trigger event is witnessed. * Called when a generic sound trigger event is witnessed. Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java +3 −4 Original line number Original line Diff line number Diff line Loading @@ -318,7 +318,7 @@ final class HotwordDetectionConnection { if (DEBUG) { if (DEBUG) { Slog.d(TAG, "onDetected"); Slog.d(TAG, "onDetected"); } } externalCallback.onKeyphraseDetected(recognitionEvent); externalCallback.onKeyphraseDetected(recognitionEvent, result); } } @Override @Override Loading Loading @@ -351,8 +351,7 @@ final class HotwordDetectionConnection { if (DEBUG) { if (DEBUG) { Slog.d(TAG, "onDetected"); Slog.d(TAG, "onDetected"); } } // TODO: Propagate the HotwordDetectedResult. externalCallback.onKeyphraseDetected(recognitionEvent, result); externalCallback.onKeyphraseDetected(recognitionEvent); } } @Override @Override Loading Loading @@ -396,7 +395,7 @@ final class HotwordDetectionConnection { mHotwordDetectionConnection.detectFromDspSource( mHotwordDetectionConnection.detectFromDspSource( recognitionEvent, mExternalCallback); recognitionEvent, mExternalCallback); } else { } else { mExternalCallback.onKeyphraseDetected(recognitionEvent); mExternalCallback.onKeyphraseDetected(recognitionEvent, null); } } } } Loading