diff options
Diffstat (limited to 'core/java')
3 files changed, 21 insertions, 5 deletions
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java index 007f4bcd43fc..dc4f0b70651f 100644 --- a/core/java/android/hardware/soundtrigger/SoundTrigger.java +++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java @@ -611,6 +611,13 @@ public class SoundTrigger { * @hide */ public static final int RECOGNITION_STATUS_FAILURE = 2; + /** + * Recognition event was triggered by a getModelState request, not by the + * DSP. + * + * @hide + */ + public static final int RECOGNITION_STATUS_GET_STATE_RESPONSE = 3; /** * A RecognitionEvent is provided by the diff --git a/core/java/android/hardware/soundtrigger/SoundTriggerModule.java b/core/java/android/hardware/soundtrigger/SoundTriggerModule.java index e970747d6642..402c228b93b1 100644 --- a/core/java/android/hardware/soundtrigger/SoundTriggerModule.java +++ b/core/java/android/hardware/soundtrigger/SoundTriggerModule.java @@ -133,12 +133,21 @@ public class SoundTriggerModule { public native int stopRecognition(int soundModelHandle); /** - * Get the current state of a {@link SoundTrigger.SoundModel} + * Get the current state of a {@link SoundTrigger.SoundModel}. + * The state will be returned asynchronously as a {@link SoundTrigger#RecognitionEvent} + * in the callback registered in the {@link SoundTrigger.startRecognition} method. * @param soundModelHandle The sound model handle indicating which model's state to return - * @return - {@link SoundTrigger#RecognitionEvent} in case of success - * - null in case of an error or if not supported + * @return - {@link SoundTrigger#STATUS_OK} in case of success + * - {@link SoundTrigger#STATUS_ERROR} in case of unspecified error + * - {@link SoundTrigger#STATUS_PERMISSION_DENIED} if the caller does not have + * system permission + * - {@link SoundTrigger#STATUS_NO_INIT} if the native service cannot be reached + * - {@link SoundTrigger#STATUS_BAD_VALUE} if the sound model handle is invalid + * - {@link SoundTrigger#STATUS_DEAD_OBJECT} if the binder transaction to the native + * service fails + * - {@link SoundTrigger#STATUS_INVALID_OPERATION} if the call is out of sequence */ - public native SoundTrigger.RecognitionEvent getModelState(int soundModelHandle); + public native int getModelState(int soundModelHandle); private class NativeEventHandlerDelegate { private final Handler mHandler; diff --git a/core/java/com/android/internal/app/ISoundTriggerService.aidl b/core/java/com/android/internal/app/ISoundTriggerService.aidl index c0c689ced521..764c0cfbd01c 100644 --- a/core/java/com/android/internal/app/ISoundTriggerService.aidl +++ b/core/java/com/android/internal/app/ISoundTriggerService.aidl @@ -53,5 +53,5 @@ interface ISoundTriggerService { /** For both ...Intent and ...Service based usage */ boolean isRecognitionActive(in ParcelUuid parcelUuid); - SoundTrigger.RecognitionEvent getModelState(in ParcelUuid parcelUuid); + int getModelState(in ParcelUuid soundModelId); } |
