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

Unverified Commit b695c398 authored by Steve Kondik's avatar Steve Kondik Committed by Michael Bestas
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
parent 51f3d94f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4852,7 +4852,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_BTA2DP_DOCK_TIMEOUT: