Merge "expand test API for DSP kephrase trigger" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ad2aa52507
@@ -2429,7 +2429,7 @@ package android.service.quicksettings {
|
|||||||
package android.service.voice {
|
package android.service.voice {
|
||||||
|
|
||||||
public class AlwaysOnHotwordDetector implements android.service.voice.HotwordDetector {
|
public class AlwaysOnHotwordDetector implements android.service.voice.HotwordDetector {
|
||||||
method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public void triggerHardwareRecognitionEventForTest(int, int, boolean, int, int, int, boolean, @NonNull android.media.AudioFormat, @Nullable byte[]);
|
method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public void triggerHardwareRecognitionEventForTest(int, int, boolean, int, int, int, boolean, @NonNull android.media.AudioFormat, @Nullable byte[], @NonNull java.util.List<android.hardware.soundtrigger.SoundTrigger.KeyphraseRecognitionExtra>);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class AlwaysOnHotwordDetector.EventPayload.Builder {
|
public static final class AlwaysOnHotwordDetector.EventPayload.Builder {
|
||||||
|
|||||||
@@ -851,7 +851,8 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector {
|
|||||||
@RequiresPermission(allOf = {RECORD_AUDIO, CAPTURE_AUDIO_HOTWORD})
|
@RequiresPermission(allOf = {RECORD_AUDIO, CAPTURE_AUDIO_HOTWORD})
|
||||||
public void triggerHardwareRecognitionEventForTest(int status, int soundModelHandle,
|
public void triggerHardwareRecognitionEventForTest(int status, int soundModelHandle,
|
||||||
boolean captureAvailable, int captureSession, int captureDelayMs, int capturePreambleMs,
|
boolean captureAvailable, int captureSession, int captureDelayMs, int capturePreambleMs,
|
||||||
boolean triggerInData, @NonNull AudioFormat captureFormat, @Nullable byte[] data) {
|
boolean triggerInData, @NonNull AudioFormat captureFormat, @Nullable byte[] data,
|
||||||
|
@NonNull List<KeyphraseRecognitionExtra> keyphraseRecognitionExtras) {
|
||||||
Log.d(TAG, "triggerHardwareRecognitionEventForTest()");
|
Log.d(TAG, "triggerHardwareRecognitionEventForTest()");
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (mAvailability == STATE_INVALID || mAvailability == STATE_ERROR) {
|
if (mAvailability == STATE_INVALID || mAvailability == STATE_ERROR) {
|
||||||
@@ -862,7 +863,8 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector {
|
|||||||
mModelManagementService.triggerHardwareRecognitionEventForTest(
|
mModelManagementService.triggerHardwareRecognitionEventForTest(
|
||||||
new KeyphraseRecognitionEvent(status, soundModelHandle, captureAvailable,
|
new KeyphraseRecognitionEvent(status, soundModelHandle, captureAvailable,
|
||||||
captureSession, captureDelayMs, capturePreambleMs, triggerInData,
|
captureSession, captureDelayMs, capturePreambleMs, triggerInData,
|
||||||
captureFormat, data, null /* keyphraseExtras */),
|
captureFormat, data, keyphraseRecognitionExtras.toArray(
|
||||||
|
new KeyphraseRecognitionExtra[0])),
|
||||||
mInternalCallback);
|
mInternalCallback);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
|
|||||||
Reference in New Issue
Block a user