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

Commit 89ca569a authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Roman Birg
Browse files

base: update link ring-notifications after read user settings

Change-Id: Ib424124dc20e38243e572333e323ba97aacb1111
JIRA: CYAN-3559
Issue: https://jira.cyanogenmod.org/browse/CYAN-3559


Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 5b70f5b8
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -541,6 +541,8 @@ public class AudioService extends IAudioService.Stub {
        // array initialized by updateStreamVolumeAlias()
        updateStreamVolumeAlias(false /*updateVolumes*/);
        readPersistedSettings();
        // must update link ring-notifications streams once the user preferences were read
        updateLinkNotificationStreamVolumeAlias();
        mSettingsObserver = new SettingsObserver();
        createStreamStates();

@@ -681,11 +683,7 @@ public class AudioService extends IAudioService.Stub {
        }
        mStreamVolumeAlias[AudioSystem.STREAM_DTMF] = dtmfStreamAlias;

        if (mLinkNotificationWithVolume) {
            mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING;
        } else {
            mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION;
        }
        updateLinkNotificationStreamVolumeAlias();

        if (updateVolumes) {
            mStreamStates[AudioSystem.STREAM_DTMF].setAllIndexes(mStreamStates[dtmfStreamAlias]);
@@ -700,6 +698,14 @@ public class AudioService extends IAudioService.Stub {
        }
    }

    private void updateLinkNotificationStreamVolumeAlias() {
        if (mLinkNotificationWithVolume) {
            mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING;
        } else {
            mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION;
        }
    }

    private void readDockAudioSettings(ContentResolver cr)
    {
        mDockAudioMediaEnabled = Settings.Global.getInt(