summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/soundtrigger
diff options
context:
space:
mode:
authorSandeep Siddhartha <sansid@google.com>2014-08-01 11:32:03 -0700
committerSandeep Siddhartha <sansid@google.com>2014-08-01 17:46:27 -0700
commit2c0273e50a3162595e9a54030166f2369b039a5a (patch)
tree6075295a33de952b996038ffdf10f22594a1cf4b /core/java/android/hardware/soundtrigger
parentfc0fc0e341f2a2d707d5a8eafd65db34bdffb35c (diff)
downloadframeworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.zip
frameworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.tar.gz
frameworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.tar.bz2
Add a flag for multiple triggers with same recognition session
Also annotate the flags with @IntDef to make things clearer and safer Add more debug logging Revert to start/stop being synchronous since telephony and microphone will need to be handled internally. Bug: 16731586 Bug: 16514535 Bug: 16549061 Change-Id: I83695d52e9547269c95d443e4d921c9238b7401e
Diffstat (limited to 'core/java/android/hardware/soundtrigger')
-rw-r--r--core/java/android/hardware/soundtrigger/SoundTrigger.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java
index 4498789..adee740 100644
--- a/core/java/android/hardware/soundtrigger/SoundTrigger.java
+++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java
@@ -524,6 +524,11 @@ public class SoundTrigger {
/** True if the DSP should capture the trigger sound and make it available for further
* capture. */
public final boolean captureRequested;
+ /**
+ * True if the service should restart listening after the DSP triggers.
+ * Note: This config flag is currently used at the service layer rather than by the DSP.
+ */
+ public final boolean allowMultipleTriggers;
/** List of all keyphrases in the sound model for which recognition should be performed with
* options for each keyphrase. */
public final KeyphraseRecognitionExtra keyphrases[];
@@ -531,9 +536,10 @@ public class SoundTrigger {
* typically during enrollment. */
public final byte[] data;
- public RecognitionConfig(boolean captureRequested,
+ public RecognitionConfig(boolean captureRequested, boolean allowMultipleTriggers,
KeyphraseRecognitionExtra keyphrases[], byte[] data) {
this.captureRequested = captureRequested;
+ this.allowMultipleTriggers = allowMultipleTriggers;
this.keyphrases = keyphrases;
this.data = data;
}
@@ -551,15 +557,17 @@ public class SoundTrigger {
private static RecognitionConfig fromParcel(Parcel in) {
boolean captureRequested = in.readByte() == 1;
+ boolean allowMultipleTriggers = in.readByte() == 1;
KeyphraseRecognitionExtra[] keyphrases =
in.createTypedArray(KeyphraseRecognitionExtra.CREATOR);
byte[] data = in.readBlob();
- return new RecognitionConfig(captureRequested, keyphrases, data);
+ return new RecognitionConfig(captureRequested, allowMultipleTriggers, keyphrases, data);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeByte((byte) (captureRequested ? 1 : 0));
+ dest.writeByte((byte) (allowMultipleTriggers ? 1 : 0));
dest.writeTypedArray(keyphrases, flags);
dest.writeBlob(data);
}
@@ -571,9 +579,9 @@ public class SoundTrigger {
@Override
public String toString() {
- return "RecognitionConfig [captureRequested=" + captureRequested + ", keyphrases="
- + Arrays.toString(keyphrases)
- + ", data=" + (data == null ? 0 : data.length) + "]";
+ return "RecognitionConfig [captureRequested=" + captureRequested
+ + ", allowMultipleTriggers=" + allowMultipleTriggers + ", keyphrases="
+ + Arrays.toString(keyphrases) + ", data=" + Arrays.toString(data) + "]";
}
}