add SoundTrigger TestApis
Test APIs are added to CTS to use for SoundTrigger system API test coverage. Bug: 152354427 Test: cts-tradefed run cts -m CtsSoundTriggerTestCases Change-Id: Iea8d5f3095481a54520873b5c5e6976dc272b09c
This commit is contained in:
@@ -1360,6 +1360,86 @@ package android.hardware.soundtrigger {
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.KeyphraseMetadata> CREATOR;
|
||||
}
|
||||
|
||||
public class SoundTrigger {
|
||||
field public static final int RECOGNITION_MODE_GENERIC = 8; // 0x8
|
||||
field public static final int RECOGNITION_MODE_USER_AUTHENTICATION = 4; // 0x4
|
||||
field public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 2; // 0x2
|
||||
field public static final int RECOGNITION_MODE_VOICE_TRIGGER = 1; // 0x1
|
||||
field public static final int STATUS_OK = 0; // 0x0
|
||||
}
|
||||
|
||||
public static final class SoundTrigger.Keyphrase implements android.os.Parcelable {
|
||||
ctor public SoundTrigger.Keyphrase(int, int, @NonNull java.util.Locale, @NonNull String, @Nullable int[]);
|
||||
method public int getId();
|
||||
method @NonNull public java.util.Locale getLocale();
|
||||
method public int getRecognitionModes();
|
||||
method @NonNull public String getText();
|
||||
method @NonNull public int[] getUsers();
|
||||
method @NonNull public static android.hardware.soundtrigger.SoundTrigger.Keyphrase readFromParcel(@NonNull android.os.Parcel);
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.Keyphrase> CREATOR;
|
||||
}
|
||||
|
||||
public static final class SoundTrigger.KeyphraseSoundModel extends android.hardware.soundtrigger.SoundTrigger.SoundModel implements android.os.Parcelable {
|
||||
ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[], int);
|
||||
ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[]);
|
||||
method @NonNull public android.hardware.soundtrigger.SoundTrigger.Keyphrase[] getKeyphrases();
|
||||
method @NonNull public static android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel readFromParcel(@NonNull android.os.Parcel);
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel> CREATOR;
|
||||
}
|
||||
|
||||
public static final class SoundTrigger.ModelParamRange implements android.os.Parcelable {
|
||||
ctor public SoundTrigger.ModelParamRange(int, int);
|
||||
method public int getEnd();
|
||||
method public int getStart();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModelParamRange> CREATOR;
|
||||
}
|
||||
|
||||
public static final class SoundTrigger.ModuleProperties implements android.os.Parcelable {
|
||||
ctor public SoundTrigger.ModuleProperties(int, @NonNull String, @NonNull String, @NonNull String, int, @NonNull String, int, int, int, int, boolean, int, boolean, int, boolean, int);
|
||||
method public int describeContents();
|
||||
method public int getAudioCapabilities();
|
||||
method @NonNull public String getDescription();
|
||||
method public int getId();
|
||||
method @NonNull public String getImplementor();
|
||||
method public int getMaxBufferMillis();
|
||||
method public int getMaxKeyphrases();
|
||||
method public int getMaxSoundModels();
|
||||
method public int getMaxUsers();
|
||||
method public int getPowerConsumptionMw();
|
||||
method public int getRecognitionModes();
|
||||
method @NonNull public String getSupportedModelArch();
|
||||
method @NonNull public java.util.UUID getUuid();
|
||||
method public int getVersion();
|
||||
method public boolean isCaptureTransitionSupported();
|
||||
method public boolean isConcurrentCaptureSupported();
|
||||
method public boolean isTriggerReturnedInEvent();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = 1; // 0x1
|
||||
field public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = 2; // 0x2
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModuleProperties> CREATOR;
|
||||
}
|
||||
|
||||
public static class SoundTrigger.RecognitionEvent {
|
||||
ctor public SoundTrigger.RecognitionEvent(int, int, boolean, int, int, int, boolean, @NonNull android.media.AudioFormat, @Nullable byte[]);
|
||||
method @Nullable public android.media.AudioFormat getCaptureFormat();
|
||||
method public int getCaptureSession();
|
||||
method public byte[] getData();
|
||||
method public boolean isCaptureAvailable();
|
||||
}
|
||||
|
||||
public static class SoundTrigger.SoundModel {
|
||||
method @NonNull public byte[] getData();
|
||||
method public int getType();
|
||||
method @NonNull public java.util.UUID getUuid();
|
||||
method @NonNull public java.util.UUID getVendorUuid();
|
||||
method public int getVersion();
|
||||
field public static final int TYPE_GENERIC_SOUND = 1; // 0x1
|
||||
field public static final int TYPE_KEYPHRASE = 0; // 0x0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.location {
|
||||
|
||||
@@ -27,7 +27,9 @@ import static java.util.Objects.requireNonNull;
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.app.ActivityThread;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
@@ -57,6 +59,7 @@ import java.util.UUID;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
@SystemApi
|
||||
public class SoundTrigger {
|
||||
private static final String TAG = "SoundTrigger";
|
||||
@@ -136,7 +139,9 @@ public class SoundTrigger {
|
||||
@AudioCapabilities
|
||||
private final int mAudioCapabilities;
|
||||
|
||||
ModuleProperties(int id, @NonNull String implementor, @NonNull String description,
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public ModuleProperties(int id, @NonNull String implementor, @NonNull String description,
|
||||
@NonNull String uuid, int version, @NonNull String supportedModelArch,
|
||||
int maxSoundModels, int maxKeyphrases, int maxUsers,
|
||||
@RecognitionModes int recognitionModes, boolean supportsCaptureTransition,
|
||||
@@ -289,7 +294,7 @@ public class SoundTrigger {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
public void writeToParcel(@SuppressLint("MissingNullability") Parcel dest, int flags) {
|
||||
dest.writeInt(getId());
|
||||
dest.writeString(getImplementor());
|
||||
dest.writeString(getDescription());
|
||||
@@ -931,7 +936,9 @@ public class SoundTrigger {
|
||||
*/
|
||||
private final int mEnd;
|
||||
|
||||
ModelParamRange(int start, int end) {
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public ModelParamRange(int start, int end) {
|
||||
this.mStart = start;
|
||||
this.mEnd = end;
|
||||
}
|
||||
@@ -1159,6 +1166,7 @@ public class SoundTrigger {
|
||||
public final byte[] data;
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
@UnsupportedAppUsage
|
||||
public RecognitionEvent(int status, int soundModelHandle, boolean captureAvailable,
|
||||
int captureSession, int captureDelayMs, int capturePreambleMs,
|
||||
@@ -1209,6 +1217,7 @@ public class SoundTrigger {
|
||||
*
|
||||
* @return The data of the event
|
||||
*/
|
||||
@SuppressLint("MissingNullability")
|
||||
public byte[] getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user