am 0edd1360: Merge "Add the capture session (and its availability) in the EventPayload" into lmp-dev

* commit '0edd136087cb8a1b4b91dd581e347337878f10f9':
  Add the capture session (and its availability) in the EventPayload
This commit is contained in:
Sandeep Siddhartha
2014-08-08 22:23:39 +00:00
committed by Android Git Automerger
2 changed files with 29 additions and 6 deletions

View File

@@ -27564,7 +27564,7 @@ package android.service.voice {
public static class AlwaysOnHotwordDetector.EventPayload {
field public final android.media.AudioFormat audioFormat;
field public final byte[] data;
field public final boolean isTriggerAudio;
field public final boolean triggerAvailable;
}
public class VoiceInteractionService extends android.app.Service {

View File

@@ -188,9 +188,28 @@ public class AlwaysOnHotwordDetector {
/**
* Indicates if {@code data} is the audio that triggered the keyphrase.
*/
public final boolean isTriggerAudio;
public final boolean triggerAvailable;
/**
* Format of {@code data}. May be null if {@code isTriggerAudio} is false.
* Indicates if {@code captureSession} can be used to continue capturing more audio from
* the DSP hardware.
*
* Candidate for public API
* @hide
*/
public final boolean captureAvailable;
/**
* The session to use when attempting to capture more audio from the DSP hardware.
*
* Candidate for public API
* TODO: When unhiding, change javadoc of audioFormat to -
* "Format of {@code data} or the audio that may be captured using {@code captureSession}.
* May be null if {@code triggerAvailable} and {@code captureAvailable} are false."
* @hide
*/
public final int captureSession;
/**
* Format of {@code data}.
* May be null if {@code triggerAvailable} is false.
*/
@Nullable
public final AudioFormat audioFormat;
@@ -201,8 +220,11 @@ public class AlwaysOnHotwordDetector {
@Nullable
public final byte[] data;
private EventPayload(boolean _isTriggerAudio, AudioFormat _audioFormat, byte[] _data) {
isTriggerAudio = _isTriggerAudio;
private EventPayload(boolean _triggerAvailable, boolean _captureAvailable,
AudioFormat _audioFormat, int _captureSession, byte[] _data) {
triggerAvailable = _triggerAvailable;
captureAvailable = _captureAvailable;
captureSession = _captureSession;
audioFormat = _audioFormat;
data = _data;
}
@@ -513,7 +535,8 @@ public class AlwaysOnHotwordDetector {
Slog.i(TAG, "onDetected");
}
Message.obtain(mHandler, MSG_HOTWORD_DETECTED,
new EventPayload(event.triggerInData, event.captureFormat, event.data))
new EventPayload(event.triggerInData, event.captureAvailable,
event.captureFormat, event.captureSession, event.data))
.sendToTarget();
}