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

Commit 24c05187 authored by John Spurlock's avatar John Spurlock
Browse files

Use shared value for default muteable streams.

Change-Id: Ib8fa7aee3bed83fc26945fd0caf0cbd9f4f8af3a
parent dec7d389
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -356,6 +356,12 @@ public class AudioService extends IAudioService.Stub {
            "STREAM_TTS"
    };

    public static final int DEFAULT_MUTE_STREAMS_AFFECTED =
            (1 << AudioSystem.STREAM_MUSIC) |
            (1 << AudioSystem.STREAM_RING) |
            (1 << AudioSystem.STREAM_NOTIFICATION) |
            (1 << AudioSystem.STREAM_SYSTEM);

    private final AudioSystem.ErrorCallback mAudioSystemCallback = new AudioSystem.ErrorCallback() {
        public void onError(int error) {
            switch (error) {
@@ -899,10 +905,7 @@ public class AudioService extends IAudioService.Stub {
        }

        mMuteAffectedStreams = System.getIntForUser(cr,
                System.MUTE_STREAMS_AFFECTED,
                ((1 << AudioSystem.STREAM_MUSIC)|
                 (1 << AudioSystem.STREAM_RING)|
                 (1 << AudioSystem.STREAM_SYSTEM)),
                System.MUTE_STREAMS_AFFECTED, DEFAULT_MUTE_STREAMS_AFFECTED,
                UserHandle.USER_CURRENT);

        boolean masterMute = System.getIntForUser(cr, System.VOLUME_MASTER_MUTE,
+1 −4
Original line number Diff line number Diff line
@@ -2236,10 +2236,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
                    ringerModeAffectedStreams);

            loadSetting(stmt, Settings.System.MUTE_STREAMS_AFFECTED,
                    ((1 << AudioManager.STREAM_MUSIC) |
                     (1 << AudioManager.STREAM_RING) |
                     (1 << AudioManager.STREAM_NOTIFICATION) |
                     (1 << AudioManager.STREAM_SYSTEM)));
                    AudioService.DEFAULT_MUTE_STREAMS_AFFECTED);
        } finally {
            if (stmt != null) stmt.close();
        }