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

Commit baf0eefd authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "Move 'start music player on headset connection' option out of DSPManager (1/2)" into cm-10.2

parents 1089e54a 1f7af656
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();