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

Commit f414f5d2 authored by maxwen's avatar maxwen Committed by Gerrit Code Review
Browse files

Default device volumes not initialised

After fresh rom install default device volumes are not initialised
and therefore muted.

Only after manually changing a device volume it can be used.
IMHO the check for AudioSystem.DEVICE_OUT_DEFAULT here is not correct
since it will not init mIndex and mLastAudibleIndex collections.

Maybe there is a better way to fix this
parent 35dfa1f5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2493,10 +2493,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished {

                // retrieve current volume for device
                String name = getSettingNameForDevice(false /* lastAudible */, device);
                // if no volume stored for current stream and device, use default volume if default
                // device, continue otherwise
                int defaultIndex = (device == AudioSystem.DEVICE_OUT_DEFAULT) ?
                                        AudioManager.DEFAULT_STREAM_VOLUME[mStreamType] : -1;
                // if no volume stored for current stream and device, use default volume
                int defaultIndex = AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
                int index = Settings.System.getInt(mContentResolver, name, defaultIndex);
                if (index == -1) {
                    continue;