Merge "Handle the client volume mute events"
diff --git a/media/java/android/media/AudioPlaybackConfiguration.java b/media/java/android/media/AudioPlaybackConfiguration.java
index c213fcc..9a3d369 100644
--- a/media/java/android/media/AudioPlaybackConfiguration.java
+++ b/media/java/android/media/AudioPlaybackConfiguration.java
@@ -243,12 +243,17 @@
      * 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 @@
                 + " 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);
     }
 
     //=====================================================================
diff --git a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
index 9ff72d3..f3ddd21 100644
--- a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
+++ b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
@@ -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 @@
                             (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();