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

Commit cb9ce7dc authored by Atneya Nair's avatar Atneya Nair
Browse files

[audio] Add new mute type to AudioManager

For consistency between Java/native.

Test: compiles
Flag: EXEMPT, safe
Bug: 376481063
Change-Id: I3368bdfd38623218f574ab60109df9b64700fa63
parent d0efb167
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ namespace android {
// must be kept in sync with definitions in AudioPlaybackConfiguration.java
#define PLAYER_PIID_INVALID -1

// TODO (b/309532236) remove manual IAudioManager impl in favor of AIDL.
typedef enum {
    PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11,
    PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12,
@@ -60,6 +61,7 @@ enum {
    PLAYER_MUTE_CLIENT_VOLUME = (1 << 4),
    PLAYER_MUTE_VOLUME_SHAPER = (1 << 5),
    PLAYER_MUTE_PORT_VOLUME = (1 << 6),
    PLAYER_MUTE_OP_AUDIO_CONTROL = (1 << 7),
};

struct mute_state_t {
@@ -77,6 +79,8 @@ struct mute_state_t {
    bool muteFromVolumeShaper = false;
    /** Flag used when volume is muted by port volume. */
    bool muteFromPortVolume = false;
    /** Flag used when volume is muted by audio control op. */
    bool muteFromOpAudioControl = false;

    explicit operator int() const
    {
@@ -87,6 +91,7 @@ struct mute_state_t {
        result |= muteFromClientVolume * PLAYER_MUTE_CLIENT_VOLUME;
        result |= muteFromVolumeShaper * PLAYER_MUTE_VOLUME_SHAPER;
        result |= muteFromPortVolume * PLAYER_MUTE_PORT_VOLUME;
        result |= muteFromOpAudioControl * PLAYER_MUTE_OP_AUDIO_CONTROL;
        return result;
    }