diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/hardware/soundtrigger/SoundTrigger.java | 5 | ||||
-rw-r--r-- | core/jni/android_hardware_SoundTrigger.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java index 7a49eb5..7390e2b 100644 --- a/core/java/android/hardware/soundtrigger/SoundTrigger.java +++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java @@ -480,7 +480,7 @@ public class SoundTrigger { int capturePreambleMs = in.readInt(); boolean triggerInData = in.readByte() == 1; AudioFormat captureFormat = null; - if (triggerInData) { + if (in.readByte() == 1) { int sampleRate = in.readInt(); int encoding = in.readInt(); int channelMask = in.readInt(); @@ -508,7 +508,8 @@ public class SoundTrigger { dest.writeInt(captureSession); dest.writeInt(captureDelayMs); dest.writeInt(capturePreambleMs); - if (triggerInData && (captureFormat != null)) { + dest.writeByte((byte) (triggerInData ? 1 : 0)); + if (captureFormat != null) { dest.writeByte((byte)1); dest.writeInt(captureFormat.getSampleRate()); dest.writeInt(captureFormat.getEncoding()); diff --git a/core/jni/android_hardware_SoundTrigger.cpp b/core/jni/android_hardware_SoundTrigger.cpp index f0d7a35..7b33bc2 100644 --- a/core/jni/android_hardware_SoundTrigger.cpp +++ b/core/jni/android_hardware_SoundTrigger.cpp @@ -211,7 +211,7 @@ void JNISoundTriggerCallback::onRecognitionEvent(struct sound_trigger_recognitio } jobject jAudioFormat = NULL; - if (event->trigger_in_data) { + if (event->trigger_in_data || event->capture_available) { jAudioFormat = env->NewObject(gAudioFormatClass, gAudioFormatCstor, audioFormatFromNative(event->audio_config.format), |