From 39fcca0a503658f91a14b4b1d35dfc4ac9fce9d9 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 5 Sep 2014 16:44:19 -0700 Subject: SoundTrigger: fix capture format in recognition event Also include capture format in recognition event if capture is available for streaming. It was only included if trigger was contained in event. Bug: 17409062 Bug: 16731718 Change-Id: I5bf566e6bda57f23c870b4a1293e9b6d15d51e5a --- core/java/android/hardware/soundtrigger/SoundTrigger.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/java/android') 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()); -- cgit v1.1