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

Commit e74962c4 authored by Albert Tang's avatar Albert Tang Committed by Michael W
Browse files

Eleven: Add repeat button for Android Auto

Change-Id: I224927bf04691c26548622347c501d95355b044b
parent 56d3de5a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -839,6 +839,8 @@ public class MusicPlaybackService extends MediaBrowserService
            public void onCustomAction(@NonNull String action, @Nullable Bundle extras) {
                if (action.equals(SHUFFLE_ACTION)) {
                    cycleShuffle();
                } else if (action.equals(REPEAT_ACTION)) {
                    cycleRepeat();
                }
            }
        });
@@ -1648,6 +1650,10 @@ public class MusicPlaybackService extends MediaBrowserService
                SHUFFLE_ACTION,
                getString(R.string.menu_shuffle_item),
                R.drawable.btn_playback_shuffle_all).build());
        stateBuilder.addCustomAction(new PlaybackState.CustomAction.Builder(
                REPEAT_ACTION,
                getString(R.string.accessibility_repeat),
                R.drawable.btn_playback_repeat_all).build());

        if (what.equals(PLAYSTATE_CHANGED) || what.equals(POSITION_CHANGED)) {
            mSession.setPlaybackState(stateBuilder.build());