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

Commit 9849c540 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[audio] Add new mute type to AudioManager" into main

parents d71f5866 cb9ce7dc
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;
    }