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

Commit ad5eb839 authored by Steve Kondik's avatar Steve Kondik Committed by Sam Mortimer
Browse files

audio: Don't play sound effects if stream is muted

 * Stop turning on the audio hardware and playing silence.
 * Kind of annoying with certain types of Bluetooth headphones
   that don't actually play silence very well (hissssssssss).
   Not to mention power usage.

Change-Id: I6985db8710f8b0f61619ac57e8efb9e4e01cc31a
(cherry picked from commit 0e8a502ff119d285fdbbf521c45213b0b42b3d6f)
parent 139685e5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -5393,7 +5393,11 @@ public class AudioService extends IAudioService.Stub
                    break;

                case MSG_PLAY_SOUND_EFFECT:
                    if (isStreamMute(AudioSystem.STREAM_SYSTEM)) {
                        Log.d(TAG, "Stream muted, skip playback");
                    } else {
                        onPlaySoundEffect(msg.arg1, msg.arg2);
                    }
                    break;

                case MSG_SET_FORCE_USE: