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

Commit cc98c67e authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Define AudioMix state constants

Bug 20226914

Change-Id: Ie513fcdaaffd4ae3ed7fbd8d24fe8683959739e3
parent 564eb45b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17855,6 +17855,10 @@ package android.media.audiofx {
package android.media.audiopolicy {
  public class AudioMix {
    method public int getMixState();
    field public static final int MIX_STATE_DISABLED = -1; // 0xffffffff
    field public static final int MIX_STATE_IDLE = 0; // 0x0
    field public static final int MIX_STATE_MIXING = 1; // 0x1
    field public static final int ROUTE_FLAG_LOOP_BACK = 2; // 0x2
    field public static final int ROUTE_FLAG_RENDER = 1; // 0x1
  }
+36 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public class AudioMix {
    private int mRouteFlags;
    private String mRegistrationId;
    private int mMixType = MIX_TYPE_INVALID;
    private int mMixState = MIX_STATE_DISABLED;

    /**
     * All parameters are guaranteed valid through the Builder.
@@ -48,6 +49,7 @@ public class AudioMix {
        mMixType = rule.getTargetMixType();
    }

    // ROUTE_FLAG_* values to keep in sync with frameworks/av/include/media/AudioPolicy.h
    /**
     * An audio mix behavior where the output of the mix is sent to the original destination of
     * the audio signal, i.e. an output device for an output mix, or a recording for an input mix.
@@ -62,6 +64,7 @@ public class AudioMix {
    @SystemApi
    public static final int ROUTE_FLAG_LOOP_BACK = 0x1 << 1;

    // MIX_TYPE_* values to keep in sync with frameworks/av/include/media/AudioPolicy.h
    /**
     * @hide
     * Invalid mix type, default value.
@@ -78,6 +81,39 @@ public class AudioMix {
     */
    public static final int MIX_TYPE_RECORDERS = 1;


    // MIX_STATE_* values to keep in sync with frameworks/av/include/media/AudioPolicy.h
    /**
     * @hide
     * State of a mix before its policy is enabled.
     */
    @SystemApi
    public static final int MIX_STATE_DISABLED = -1;
    /**
     * @hide
     * State of a mix when there is no audio to mix.
     */
    @SystemApi
    public static final int MIX_STATE_IDLE = 0;
    /**
     * @hide
     * State of a mix that is actively mixing audio.
     */
    @SystemApi
    public static final int MIX_STATE_MIXING = 1;

    /**
     * @hide
     * The current mixing state.
     * @return one of {@link #MIX_STATE_DISABLED}, {@link #MIX_STATE_IDLE},
     *          {@link #MIX_STATE_MIXING}.
     */
    @SystemApi
    public int getMixState() {
        return mMixState;
    }


    int getRouteFlags() {
        return mRouteFlags;
    }