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

Commit 31db4124 authored by Dorin Drimus's avatar Dorin Drimus Committed by Android (Google) Code Review
Browse files

Merge "Remove redundant broadcasts when adjusting volume on single volume devices" into main

parents 9335a252 858102a5
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -8677,8 +8677,12 @@ public class AudioService extends IAudioService.Stub
                // fire changed intents for all streams, but only when the device it changed on
                //  is the current device
                if ((index != oldIndex) && isCurrentDevice) {
                    // for single volume devices, only send the volume change broadcast
                    // on the alias stream
                    if (!mIsSingleVolume || (mStreamVolumeAlias[mStreamType] == mStreamType)) {
                        mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index);
                    mVolumeChanged.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, oldIndex);
                        mVolumeChanged.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE,
                                oldIndex);
                        mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE_ALIAS,
                                mStreamVolumeAlias[mStreamType]);
                        AudioService.sVolumeLogger.enqueue(new VolChangedBroadcastEvent(
@@ -8686,6 +8690,7 @@ public class AudioService extends IAudioService.Stub
                        sendBroadcastToAll(mVolumeChanged, mVolumeChangedOptions);
                    }
                }
            }
            return changed;
        }