Merge "add IntRange to KeyphraseRecognitionExtra APIs" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c9476b6dbd
@@ -5248,7 +5248,7 @@ package android.hardware.soundtrigger {
|
||||
|
||||
public static final class SoundTrigger.KeyphraseRecognitionExtra implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public int getCoarseConfidenceLevel();
|
||||
method @IntRange(from=0, to=100) public int getCoarseConfidenceLevel();
|
||||
method public int getKeyphraseId();
|
||||
method public int getRecognitionModes();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
|
||||
@@ -29,6 +29,7 @@ import static android.system.OsConstants.EPIPE;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.IntRange;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.RequiresPermission;
|
||||
@@ -1630,7 +1631,8 @@ public class SoundTrigger {
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public KeyphraseRecognitionExtra(int id, int recognitionModes, int coarseConfidenceLevel,
|
||||
public KeyphraseRecognitionExtra(int id, int recognitionModes,
|
||||
@IntRange(from = 0, to = 100) int coarseConfidenceLevel,
|
||||
@Nullable ConfidenceLevel[] confidenceLevels) {
|
||||
this.id = id;
|
||||
this.recognitionModes = recognitionModes;
|
||||
@@ -1660,6 +1662,7 @@ public class SoundTrigger {
|
||||
*
|
||||
* <p>The confidence level is expressed in percent (0% -100%).
|
||||
*/
|
||||
@IntRange(from = 0, to = 100)
|
||||
public int getCoarseConfidenceLevel() {
|
||||
return coarseConfidenceLevel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user