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

Commit 98ad9b9d authored by Eric Laurent's avatar Eric Laurent
Browse files

Fix music volume regression on tablets

A regression was introduced by the change enabling per device volume:
music volume will not be completely silenced even if volume is shown at 0.

The problem is that when media volume goes to zero, silent mode is entered and
AudioService sends one message per stream/per connected device to the audiosystem
handler to mute volume on each stream. As those messages were sent with the
SENDMSG_NOOP attribute, some of them where lost.

Change-Id: Ic665b1e9dcaf09506a4ec19bf3fe6997d4b071fd
parent 870084d2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -591,7 +591,7 @@ public class AudioService extends IAudioService.Stub {
                        // Post a persist volume msg
                        sendMsg(mAudioHandler,
                                MSG_PERSIST_VOLUME,
                                SENDMSG_REPLACE,
                                SENDMSG_QUEUE,
                                PERSIST_LAST_AUDIBLE,
                                device,
                                s,
@@ -606,7 +606,7 @@ public class AudioService extends IAudioService.Stub {
                // to persist). Do not change volume if stream is muted.
                sendMsg(mAudioHandler,
                        MSG_SET_DEVICE_VOLUME,
                        SENDMSG_NOOP,
                        SENDMSG_QUEUE,
                        device,
                        0,
                        streamState,
@@ -746,7 +746,7 @@ public class AudioService extends IAudioService.Stub {
                // Post a persist volume msg
                sendMsg(mAudioHandler,
                        MSG_PERSIST_VOLUME,
                        SENDMSG_REPLACE,
                        SENDMSG_QUEUE,
                        PERSIST_LAST_AUDIBLE,
                        device,
                        streamState,
@@ -758,7 +758,7 @@ public class AudioService extends IAudioService.Stub {
                // to persist).
                sendMsg(mAudioHandler,
                        MSG_SET_DEVICE_VOLUME,
                        SENDMSG_NOOP,
                        SENDMSG_QUEUE,
                        device,
                        0,
                        streamState,
@@ -2208,7 +2208,7 @@ public class AudioService extends IAudioService.Stub {
                                    }
                                    sendMsg(mAudioHandler,
                                            MSG_SET_ALL_VOLUMES,
                                            SENDMSG_NOOP,
                                            SENDMSG_QUEUE,
                                            0,
                                            0,
                                            VolumeStreamState.this, 0);
@@ -2252,7 +2252,7 @@ public class AudioService extends IAudioService.Stub {
                                        }
                                        sendMsg(mAudioHandler,
                                                MSG_SET_ALL_VOLUMES,
                                                SENDMSG_NOOP,
                                                SENDMSG_QUEUE,
                                                0,
                                                0,
                                                VolumeStreamState.this, 0);
@@ -2350,7 +2350,7 @@ public class AudioService extends IAudioService.Stub {
            // Post a persist volume msg
            sendMsg(mAudioHandler,
                    MSG_PERSIST_VOLUME,
                    SENDMSG_REPLACE,
                    SENDMSG_QUEUE,
                    PERSIST_CURRENT|PERSIST_LAST_AUDIBLE,
                    device,
                    streamState,