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

Commit b3f935d5 authored by Vlad Popa's avatar Vlad Popa
Browse files

Improve dumpsys for setLeAudioVolume

Logging the stream type for which the volume is set

Test: adb shell dumpsys audio
Bug: 324341958
Change-Id: I885efd7db737e3ccbae3bfc99205a8dae06c2981
parent 455a7381
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ public class AudioServiceEvents {
        /** used for VOL_ADJUST_VOL_UID,
         *           VOL_ADJUST_SUGG_VOL,
         *           VOL_ADJUST_STREAM_VOL,
         *           VOL_SET_LE_AUDIO_VOL
         */
        VolumeEvent(int op, int stream, int val1, int val2, String caller) {
            mOp = op;
@@ -434,6 +435,8 @@ public class AudioServiceEvents {
                            .set(MediaMetrics.Property.EVENT, "setLeAudioVolume")
                            .set(MediaMetrics.Property.INDEX, mVal1)
                            .set(MediaMetrics.Property.MAX_INDEX, mVal2)
                            .set(MediaMetrics.Property.STREAM_TYPE,
                                    AudioSystem.streamToString(mStream))
                            .record();
                    return;
                case VOL_SET_AVRCP_VOL:
@@ -519,7 +522,8 @@ public class AudioServiceEvents {
                            .append(" gain dB:").append(mVal2)
                            .toString();
                case VOL_SET_LE_AUDIO_VOL:
                    return new StringBuilder("setLeAudioVolume:")
                    return new StringBuilder("setLeAudioVolume(stream:")
                            .append(AudioSystem.streamToString(mStream))
                            .append(" index:").append(mVal1)
                            .append(" maxIndex:").append(mVal2)
                            .toString();
+2 −1
Original line number Diff line number Diff line
@@ -470,7 +470,8 @@ public class BtHelper {
                    + index + " volume=" + volume);
        }
        AudioService.sVolumeLogger.enqueue(new AudioServiceEvents.VolumeEvent(
                AudioServiceEvents.VolumeEvent.VOL_SET_LE_AUDIO_VOL, index, maxIndex));
                AudioServiceEvents.VolumeEvent.VOL_SET_LE_AUDIO_VOL, streamType, index,
                maxIndex, /*caller=*/null));
        try {
            mLeAudio.setVolume(volume);
        } catch (Exception e) {