summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/soundtrigger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-09-12 15:45:47 -0700
committerEric Laurent <elaurent@google.com>2014-09-12 15:45:47 -0700
commit75b433f737c3f45ac111a13876c0fd450b0b94ec (patch)
treecba976d8bc0b382b4e8bfa50c1af84ae28eba5d6 /core/java/android/hardware/soundtrigger
parentd6adcef917aac893fd82e7628781145693d6187f (diff)
downloadframeworks_base-75b433f737c3f45ac111a13876c0fd450b0b94ec.zip
frameworks_base-75b433f737c3f45ac111a13876c0fd450b0b94ec.tar.gz
frameworks_base-75b433f737c3f45ac111a13876c0fd450b0b94ec.tar.bz2
SoundTrigger: fix KeyphraseRecognitionEvent parceling
Always include the Audioformat in the parcel if not null. Bug: 17489186. Change-Id: I8bea031942b55078e5637959d5bf70961d134733
Diffstat (limited to 'core/java/android/hardware/soundtrigger')
-rw-r--r--core/java/android/hardware/soundtrigger/SoundTrigger.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java
index 7390e2b..746ead2 100644
--- a/core/java/android/hardware/soundtrigger/SoundTrigger.java
+++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java
@@ -873,7 +873,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();
@@ -899,7 +899,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());