Handle the client volume mute events
Logging the new client volume events in the audio dumpsys. Test: dumpsys audio Bug: 235521198 Change-Id: I558964b1280654a93a5aff86faef72b5723cdb0d
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//=====================================================================
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user