Merge "Revert "Revert "Adding getModelState API to sound trigger"""

This commit is contained in:
Michael Dooley
2018-09-28 06:24:43 +00:00
committed by Android (Google) Code Review
6 changed files with 157 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import android.annotation.UnsupportedAppUsage;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import java.lang.ref.WeakReference;
/**
@@ -131,6 +132,14 @@ public class SoundTriggerModule {
@UnsupportedAppUsage
public native int stopRecognition(int soundModelHandle);
/**
* Get the current state of a {@link SoundTrigger.SoundModel}
* @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
*/
public native SoundTrigger.RecognitionEvent getModelState(int soundModelHandle);
private class NativeEventHandlerDelegate {
private final Handler mHandler;
@@ -207,4 +216,3 @@ public class SoundTriggerModule {
}
}
}