Add ability to get soundtrigger props from dsp
exposes sound trigger module properties to privileged
system apps with MANAGE_SOUND_TRIGGER permission
Bug: 139071862
Test: GTS test confirmed API accessible and providing valid data
Change-Id: Iec7ba6fc59912f44341fbe8d7f99193b9ead52f0
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java
index 5b5bd76..8a9617e 100644
--- a/core/java/android/hardware/soundtrigger/SoundTrigger.java
+++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java
@@ -22,6 +22,7 @@
import static android.system.OsConstants.EPERM;
import static android.system.OsConstants.EPIPE;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
@@ -70,28 +71,27 @@
* ID used to target any API call to this paricular module. Module
* properties are returned by listModules() method.
*
- * @hide
****************************************************************************/
- public static class ModuleProperties implements Parcelable {
+ public static final class ModuleProperties implements Parcelable {
/** Unique module ID provided by the native service */
- @UnsupportedAppUsage
public final int id;
/** human readable voice detection engine implementor */
+ @NonNull
public final String implementor;
/** human readable voice detection engine description */
+ @NonNull
public final String description;
/** Unique voice engine Id (changes with each version) */
- @UnsupportedAppUsage
+ @NonNull
public final UUID uuid;
/** Voice detection engine version */
public final int version;
/** Maximum number of active sound models */
- @UnsupportedAppUsage
public final int maxSoundModels;
/** Maximum number of key phrases */
@@ -119,7 +119,6 @@
* recognition callback event */
public final boolean returnsTriggerInEvent;
- @UnsupportedAppUsage
ModuleProperties(int id, String implementor, String description,
String uuid, int version, int maxSoundModels, int maxKeyphrases,
int maxUsers, int recognitionModes, boolean supportsCaptureTransition,