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

Commit 10c820b9 authored by Vlad Popa's avatar Vlad Popa
Browse files

Handle the client volume mute events

Logging the new client volume events in the audio dumpsys.

Test: dumpsys audio
Bug: 235521198
Change-Id: I558964b1280654a93a5aff86faef72b5723cdb0d
parent 78c33bb4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -243,12 +243,17 @@ public final class AudioPlaybackConfiguration implements Parcelable {
     * Flag used when playback is restricted by AppOps manager with OP_PLAY_AUDIO.
     */
    public static final int PLAYER_MUTE_PLAYBACK_RESTRICTED = (1 << 3);
    /**
     * @hide
     * Flag used when muted by client volume.
     */
    public static final int PLAYER_MUTE_CLIENT_VOLUME = (1 << 4);

    /** @hide */
    @IntDef(
            flag = true,
            value = {PLAYER_MUTE_MASTER, PLAYER_MUTE_STREAM_VOLUME, PLAYER_MUTE_STREAM_MUTED,
                    PLAYER_MUTE_PLAYBACK_RESTRICTED})
                    PLAYER_MUTE_PLAYBACK_RESTRICTED, PLAYER_MUTE_CLIENT_VOLUME})
    @Retention(RetentionPolicy.SOURCE)
    public @interface PlayerMuteEvent {
    }
@@ -678,7 +683,8 @@ public final class AudioPlaybackConfiguration implements Parcelable {
                + " muteFromStreamVolume=" + ((mMutedState & PLAYER_MUTE_STREAM_VOLUME) != 0)
                + " muteFromStreamMuted=" + ((mMutedState & PLAYER_MUTE_STREAM_MUTED) != 0)
                + " muteFromPlaybackRestricted=" + ((mMutedState & PLAYER_MUTE_PLAYBACK_RESTRICTED)
                != 0);
                != 0)
                + " muteFromClientVolume=" + ((mMutedState & PLAYER_MUTE_CLIENT_VOLUME) != 0);
    }

    //=====================================================================
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.audio;

import static android.media.AudioPlaybackConfiguration.EXTRA_PLAYER_EVENT_MUTE;
import static android.media.AudioPlaybackConfiguration.PLAYER_MUTE_CLIENT_VOLUME;
import static android.media.AudioPlaybackConfiguration.PLAYER_MUTE_MASTER;
import static android.media.AudioPlaybackConfiguration.PLAYER_MUTE_PLAYBACK_RESTRICTED;
import static android.media.AudioPlaybackConfiguration.PLAYER_MUTE_STREAM_MUTED;
@@ -1145,6 +1146,8 @@ public final class PlaybackActivityMonitor
                            (mEventValue & PLAYER_MUTE_STREAM_MUTED) != 0);
                    builder.append(" muteFromPlaybackRestricted:").append(
                            (mEventValue & PLAYER_MUTE_PLAYBACK_RESTRICTED) != 0);
                    builder.append(" muteFromClientVolume:").append(
                            (mEventValue & PLAYER_MUTE_CLIENT_VOLUME) != 0);
                    return builder.toString();
                default:
                    return builder.toString();