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

Commit f6bc0fa0 authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "Add property for tracking mute caused by client volume"

parents ea7990d0 99ac9474
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ enum {
    PLAYER_MUTE_STREAM_VOLUME = (1 << 1),
    PLAYER_MUTE_STREAM_MUTED = (1 << 2),
    PLAYER_MUTE_PLAYBACK_RESTRICTED = (1 << 3),
    PLAYER_MUTE_CLIENT_VOLUME = (1 << 4),
};

struct mute_state_t {
@@ -60,6 +61,8 @@ struct mute_state_t {
    bool muteFromStreamMuted = false;
    /** Flag used when playback is restricted by AppOps manager with OP_PLAY_AUDIO. */
    bool muteFromPlaybackRestricted = false;
    /** Flag used when audio track was muted by client volume. */
    bool muteFromClientVolume = false;

    explicit operator int() const
    {
@@ -67,6 +70,7 @@ struct mute_state_t {
        result |= muteFromStreamVolume * PLAYER_MUTE_STREAM_VOLUME;
        result |= muteFromStreamMuted * PLAYER_MUTE_STREAM_MUTED;
        result |= muteFromPlaybackRestricted * PLAYER_MUTE_PLAYBACK_RESTRICTED;
        result |= muteFromClientVolume * PLAYER_MUTE_CLIENT_VOLUME;
        return result;
    }