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

Commit 29536598 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix race when sending CSD attenuation value" into main

parents 33ebad87 dbeccb00
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -9554,9 +9554,11 @@ public class AudioService extends IAudioService.Stub
                            index = (mIndexMap.valueAt(i) + 5)/10;
                        }
                        if (mStreamType == AudioSystem.STREAM_MUSIC) {
                            sendMsg(mAudioHandler, SoundDoseHelper.MSG_CSD_UPDATE_ATTENUATION,
                                SENDMSG_REPLACE, device,  isAbsoluteVolume ? 1 : 0, this,
                                    SENDMSG_QUEUE, device, isAbsoluteVolume ? 1 : 0, this,
                                    /*delay=*/0);
                        }
                        setStreamVolumeIndex(index, device);
                    }
@@ -10103,7 +10105,7 @@ public class AudioService extends IAudioService.Stub
    /*package*/ void setDeviceVolume(VolumeStreamState streamState, int device) {
        synchronized (VolumeStreamState.class) {
            sendMsg(mAudioHandler, SoundDoseHelper.MSG_CSD_UPDATE_ATTENUATION, SENDMSG_REPLACE,
            sendMsg(mAudioHandler, SoundDoseHelper.MSG_CSD_UPDATE_ATTENUATION, SENDMSG_QUEUE,
                    device, (isAbsoluteVolumeDevice(device) || isA2dpAbsoluteVolumeDevice(device)
                            || AudioSystem.isLeAudioDeviceType(device) ? 1 : 0),
                    streamState, /*delay=*/0);
+2 −2
Original line number Diff line number Diff line
@@ -657,8 +657,8 @@ public class AudioServiceEvents {
                    return "CSD lowering volume to RS1";
                case UPDATE_ABS_VOLUME_ATTENUATION:
                    return String.format(java.util.Locale.US,
                            "Updating CSD absolute volume attenuation on device %d with %.2f dB ",
                            mLongValue, mFloatValue);
                            "Updating CSD absolute volume attenuation on device 0x%s with %.2f dB ",
                            Long.toHexString(mLongValue), mFloatValue);
            }
            return new StringBuilder("FIXME invalid event type:").append(mEventType).toString();
        }