diff --git a/api/system-current.txt b/api/system-current.txt index f5e7f86abb5cf..50651198ef5b3 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3749,8 +3749,8 @@ package android.hardware.soundtrigger { public static final class SoundTrigger.ModuleProperties implements android.os.Parcelable { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); - field public static final int CAPABILITY_ECHO_CANCELLATION = 1; // 0x1 - field public static final int CAPABILITY_NOISE_SUPPRESSION = 2; // 0x2 + 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 CREATOR; field public final int audioCapabilities; field @NonNull public final String description; diff --git a/core/java/android/hardware/soundtrigger/ConversionUtil.java b/core/java/android/hardware/soundtrigger/ConversionUtil.java index a30fd6b51e767..dbf33cade60c9 100644 --- a/core/java/android/hardware/soundtrigger/ConversionUtil.java +++ b/core/java/android/hardware/soundtrigger/ConversionUtil.java @@ -17,7 +17,6 @@ package android.hardware.soundtrigger; import android.annotation.Nullable; -import android.hardware.soundtrigger.ModelParams; import android.media.AudioFormat; import android.media.audio.common.AudioConfig; import android.media.soundtrigger_middleware.AudioCapabilities; @@ -333,20 +332,22 @@ class ConversionUtil { public static int aidl2apiAudioCapabilities(int aidlCapabilities) { int result = 0; if ((aidlCapabilities & AudioCapabilities.ECHO_CANCELLATION) != 0) { - result |= SoundTrigger.ModuleProperties.CAPABILITY_ECHO_CANCELLATION; + result |= SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_ECHO_CANCELLATION; } if ((aidlCapabilities & AudioCapabilities.NOISE_SUPPRESSION) != 0) { - result |= SoundTrigger.ModuleProperties.CAPABILITY_NOISE_SUPPRESSION; + result |= SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_NOISE_SUPPRESSION; } return result; } public static int api2aidlAudioCapabilities(int apiCapabilities) { int result = 0; - if ((apiCapabilities & SoundTrigger.ModuleProperties.CAPABILITY_ECHO_CANCELLATION) != 0) { + if ((apiCapabilities & SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_ECHO_CANCELLATION) + != 0) { result |= AudioCapabilities.ECHO_CANCELLATION; } - if ((apiCapabilities & SoundTrigger.ModuleProperties.CAPABILITY_NOISE_SUPPRESSION) != 0) { + if ((apiCapabilities & SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_NOISE_SUPPRESSION) + != 0) { result |= AudioCapabilities.NOISE_SUPPRESSION; } return result; diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java index fc4c02243b9cc..a74871d29041a 100644 --- a/core/java/android/hardware/soundtrigger/SoundTrigger.java +++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java @@ -97,8 +97,8 @@ public class SoundTrigger { */ @Retention(RetentionPolicy.SOURCE) @IntDef(flag = true, prefix = { "AUDIO_CAPABILITY_" }, value = { - CAPABILITY_ECHO_CANCELLATION, - CAPABILITY_NOISE_SUPPRESSION + AUDIO_CAPABILITY_ECHO_CANCELLATION, + AUDIO_CAPABILITY_NOISE_SUPPRESSION }) public @interface AudioCapabilities {} @@ -106,12 +106,12 @@ public class SoundTrigger { * If set the underlying module supports AEC. * Describes bit field {@link ModuleProperties#audioCapabilities} */ - public static final int CAPABILITY_ECHO_CANCELLATION = 0x1; + public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = 0x1; /** * If set, the underlying module supports noise suppression. * Describes bit field {@link ModuleProperties#audioCapabilities} */ - public static final int CAPABILITY_NOISE_SUPPRESSION = 0x2; + public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = 0x2; /** Unique module ID provided by the native service */ public final int id; diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java index b9b33d0214e38..a88d389178bfd 100644 --- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java +++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java @@ -181,14 +181,14 @@ public class AlwaysOnHotwordDetector { * Returned by {@link #getSupportedAudioCapabilities()} */ public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = - SoundTrigger.ModuleProperties.CAPABILITY_ECHO_CANCELLATION; + SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_ECHO_CANCELLATION; /** * If set, the underlying module supports noise suppression. * Returned by {@link #getSupportedAudioCapabilities()} */ public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = - SoundTrigger.ModuleProperties.CAPABILITY_NOISE_SUPPRESSION; + SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_NOISE_SUPPRESSION; /** @hide */ @Retention(RetentionPolicy.SOURCE) diff --git a/media/java/android/media/soundtrigger/SoundTriggerDetector.java b/media/java/android/media/soundtrigger/SoundTriggerDetector.java index 118f65c214e11..08953392ca182 100644 --- a/media/java/android/media/soundtrigger/SoundTriggerDetector.java +++ b/media/java/android/media/soundtrigger/SoundTriggerDetector.java @@ -113,7 +113,7 @@ public final class SoundTriggerDetector { * This capability may or may not be supported by the system, and support can be queried * by calling {@link SoundTriggerManager#getModuleProperties()} and checking * {@link ModuleProperties#audioCapabilities}. The corresponding capabilities field for - * this flag is {@link SoundTrigger.ModuleProperties#CAPABILITY_ECHO_CANCELLATION}. + * this flag is {@link SoundTrigger.ModuleProperties#AUDIO_CAPABILITY_ECHO_CANCELLATION}. * If this flag is passed without the audio capability supported, there will be no audio effect * applied. */ @@ -125,8 +125,9 @@ public final class SoundTriggerDetector { * This capability may or may not be supported by the system, and support can be queried * by calling {@link SoundTriggerManager#getModuleProperties()} and checking * {@link ModuleProperties#audioCapabilities}. The corresponding capabilities field for - * this flag is {@link SoundTrigger.ModuleProperties#CAPABILITY_NOISE_SUPPRESSION}. If this flag - * is passed without the audio capability supported, there will be no audio effect applied. + * this flag is {@link SoundTrigger.ModuleProperties#AUDIO_CAPABILITY_NOISE_SUPPRESSION}. + * If this flag is passed without the audio capability supported, there will be no audio effect + * applied. */ public static final int RECOGNITION_FLAG_ENABLE_AUDIO_NOISE_SUPPRESSION = 0x8; @@ -296,10 +297,10 @@ public final class SoundTriggerDetector { int audioCapabilities = 0; if ((recognitionFlags & RECOGNITION_FLAG_ENABLE_AUDIO_ECHO_CANCELLATION) != 0) { - audioCapabilities |= SoundTrigger.ModuleProperties.CAPABILITY_ECHO_CANCELLATION; + audioCapabilities |= SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_ECHO_CANCELLATION; } if ((recognitionFlags & RECOGNITION_FLAG_ENABLE_AUDIO_NOISE_SUPPRESSION) != 0) { - audioCapabilities |= SoundTrigger.ModuleProperties.CAPABILITY_NOISE_SUPPRESSION; + audioCapabilities |= SoundTrigger.ModuleProperties.AUDIO_CAPABILITY_NOISE_SUPPRESSION; } int status;