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

Commit 1f7af656 authored by Danny Baumann's avatar Danny Baumann
Browse files

Move 'start music player on headset connection' option out of DSPManager

(1/2)

This option isn't related to DSP manager at all, so it shouldn't be
implemented there.

Change-Id: Ibe35c9739ccb4f4587ee71f514d16fb317bf4034
parent 5509a10c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4143,6 +4143,15 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
                    // Headset plugged in
                    adjustCurrentStreamVolume();
                    // TODO: Cap volume at safe levels

                    boolean launchPlayer = Settings.System.getInt(context.getContentResolver(),
                            Settings.System.HEADSET_CONNECT_PLAYER, 0) != 0;
                    if (launchPlayer) {
                        Intent playerIntent = new Intent(Intent.ACTION_MAIN);
                        playerIntent.addCategory(Intent.CATEGORY_APP_MUSIC);
                        playerIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(playerIntent);
                    }
                } else {
                    // Headset disconnected
                    adjustCurrentStreamVolume();