Loading src/org/lineageos/eleven/MusicPlaybackService.java +20 −8 Original line number Diff line number Diff line Loading @@ -834,6 +834,13 @@ public class MusicPlaybackService extends MediaBrowserService open(mSongs.stream().mapToLong(i -> i).toArray(), position, -1, IdType.NA); onPlay(); } @Override public void onCustomAction(@NonNull String action, @Nullable Bundle extras) { if (action.equals(SHUFFLE_ACTION)) { cycleShuffle(); } } }); PendingIntent pi = PendingIntent.getBroadcast(this, 0, Loading Loading @@ -1631,11 +1638,19 @@ public class MusicPlaybackService extends MediaBrowserService PlaybackState.ACTION_SKIP_TO_PREVIOUS | PlaybackState.ACTION_STOP; if (what.equals(PLAYSTATE_CHANGED) || what.equals(POSITION_CHANGED)) { mSession.setPlaybackState(new PlaybackState.Builder() PlaybackState.Builder stateBuilder = new PlaybackState.Builder() .setActions(playBackStateActions) .setActiveQueueItemId(getAudioId()) .setState(playState, position(), 1.0f).build()); .setState(playState, position(), 1.0f); // create custom action stateBuilder.addCustomAction(new PlaybackState.CustomAction.Builder( SHUFFLE_ACTION, getString(R.string.menu_shuffle_item), R.drawable.btn_playback_shuffle_all).build()); if (what.equals(PLAYSTATE_CHANGED) || what.equals(POSITION_CHANGED)) { mSession.setPlaybackState(stateBuilder.build()); } else if (what.equals(META_CHANGED) || what.equals(QUEUE_CHANGED) || QUEUE_MOVED.equals(what)) { Bitmap albumArt = getAlbumArt(false).getBitmap(); Loading Loading @@ -1665,10 +1680,7 @@ public class MusicPlaybackService extends MediaBrowserService updateMediaSessionQueue(); } mSession.setPlaybackState(new PlaybackState.Builder() .setActions(playBackStateActions) .setActiveQueueItemId(getAudioId()) .setState(playState, position(), 1.0f).build()); mSession.setPlaybackState(stateBuilder.build()); } } Loading Loading
src/org/lineageos/eleven/MusicPlaybackService.java +20 −8 Original line number Diff line number Diff line Loading @@ -834,6 +834,13 @@ public class MusicPlaybackService extends MediaBrowserService open(mSongs.stream().mapToLong(i -> i).toArray(), position, -1, IdType.NA); onPlay(); } @Override public void onCustomAction(@NonNull String action, @Nullable Bundle extras) { if (action.equals(SHUFFLE_ACTION)) { cycleShuffle(); } } }); PendingIntent pi = PendingIntent.getBroadcast(this, 0, Loading Loading @@ -1631,11 +1638,19 @@ public class MusicPlaybackService extends MediaBrowserService PlaybackState.ACTION_SKIP_TO_PREVIOUS | PlaybackState.ACTION_STOP; if (what.equals(PLAYSTATE_CHANGED) || what.equals(POSITION_CHANGED)) { mSession.setPlaybackState(new PlaybackState.Builder() PlaybackState.Builder stateBuilder = new PlaybackState.Builder() .setActions(playBackStateActions) .setActiveQueueItemId(getAudioId()) .setState(playState, position(), 1.0f).build()); .setState(playState, position(), 1.0f); // create custom action stateBuilder.addCustomAction(new PlaybackState.CustomAction.Builder( SHUFFLE_ACTION, getString(R.string.menu_shuffle_item), R.drawable.btn_playback_shuffle_all).build()); if (what.equals(PLAYSTATE_CHANGED) || what.equals(POSITION_CHANGED)) { mSession.setPlaybackState(stateBuilder.build()); } else if (what.equals(META_CHANGED) || what.equals(QUEUE_CHANGED) || QUEUE_MOVED.equals(what)) { Bitmap albumArt = getAlbumArt(false).getBitmap(); Loading Loading @@ -1665,10 +1680,7 @@ public class MusicPlaybackService extends MediaBrowserService updateMediaSessionQueue(); } mSession.setPlaybackState(new PlaybackState.Builder() .setActions(playBackStateActions) .setActiveQueueItemId(getAudioId()) .setState(playState, position(), 1.0f).build()); mSession.setPlaybackState(stateBuilder.build()); } } Loading