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

Commit 291b3914 authored by tsubus's avatar tsubus Committed by Michael Bestas
Browse files

Do not start music app when headset is unplugged

Change-Id: Ic56ba6c30a72deaf119da40e65ca83a9dcc35c43
parent ffcfe4c5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5083,14 +5083,18 @@ public class AudioService extends IAudioService.Stub {
            connType = AudioRoutesInfo.MAIN_HEADSET;
            intent.setAction(Intent.ACTION_HEADSET_PLUG);
            intent.putExtra("microphone", 1);
            if (state == 1) {
                startMusicPlayer();
            }
        } else if (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE ||
                   device == AudioSystem.DEVICE_OUT_LINE) {
            /*do apps care about line-out vs headphones?*/
            connType = AudioRoutesInfo.MAIN_HEADPHONES;
            intent.setAction(Intent.ACTION_HEADSET_PLUG);
            intent.putExtra("microphone", 0);
            if (state == 1) {
                startMusicPlayer();
            }
        } else if (device == AudioSystem.DEVICE_OUT_HDMI ||
                device == AudioSystem.DEVICE_OUT_HDMI_ARC) {
            connType = AudioRoutesInfo.MAIN_HDMI;