Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7afef8a2 authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioEffect: add missing values to Descriptor.connectMode

AudioEffect.Descriptor.connectMode is a string exposed by SDK
but only some valid values are defined by SDK.
Add missing values for pre and post processing connect modes.

Bug: 136294538
Test: make
Change-Id: I5be02c08945d37fa80eb58ab0a25a0085bb9fb58
parent fa75a86d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27608,6 +27608,8 @@ package android.media.audiofx {
    field public static final int CONTENT_TYPE_VOICE = 3; // 0x3
    field public static final String EFFECT_AUXILIARY = "Auxiliary";
    field public static final String EFFECT_INSERT = "Insert";
    field public static final String EFFECT_POST_PROCESSING = "Post Processing";
    field public static final String EFFECT_PRE_PROCESSING = "Pre Processing";
    field public static final java.util.UUID EFFECT_TYPE_AEC;
    field public static final java.util.UUID EFFECT_TYPE_AGC;
    field public static final java.util.UUID EFFECT_TYPE_BASS_BOOST;
+15 −11
Original line number Diff line number Diff line
@@ -39,16 +39,20 @@ jint convertAudioEffectDescriptorFromNative(JNIEnv* env, jobject* jDescriptor,
    jstring jImplementor;
    char str[EFFECT_STRING_LEN_MAX];

    if ((nDescriptor->flags & EFFECT_FLAG_TYPE_MASK)
        == EFFECT_FLAG_TYPE_AUXILIARY) {
    switch (nDescriptor->flags & EFFECT_FLAG_TYPE_MASK) {
        case EFFECT_FLAG_TYPE_AUXILIARY:
            jConnect = env->NewStringUTF("Auxiliary");
    } else if ((nDescriptor->flags & EFFECT_FLAG_TYPE_MASK)
        == EFFECT_FLAG_TYPE_INSERT) {
            break;
        case EFFECT_FLAG_TYPE_INSERT:
            jConnect = env->NewStringUTF("Insert");
    } else if ((nDescriptor->flags & EFFECT_FLAG_TYPE_MASK)
        == EFFECT_FLAG_TYPE_PRE_PROC) {
            break;
        case EFFECT_FLAG_TYPE_PRE_PROC:
            jConnect = env->NewStringUTF("Pre Processing");
    } else {
            break;
        case EFFECT_FLAG_TYPE_POST_PROC:
            jConnect = env->NewStringUTF("Post Processing");
            break;
        default:
            return (jint)AUDIO_JAVA_BAD_VALUE;
    }

+6 −2
Original line number Diff line number Diff line
@@ -356,10 +356,14 @@ public class AudioEffect {
    public static final String EFFECT_AUXILIARY = "Auxiliary";
    /**
     * Effect connection mode is pre processing.
     * The audio pre processing effects are attached to an audio input (AudioRecord).
     * @hide
     * The audio pre processing effects are attached to an audio input stream or device
     */
    public static final String EFFECT_PRE_PROCESSING = "Pre Processing";
    /**
     * Effect connection mode is post processing.
     * The audio post processing effects are attached to an audio output stream or device
     */
    public static final String EFFECT_POST_PROCESSING = "Post Processing";

    // --------------------------------------------------------------------------
    // Member variables