Skip to content

Commit e1fda5c

Browse files
committed
Player: Remove unused IS_MUTED intent key
The only use of the key was removed in commit 2a2c82e but the handling logic stayed around. So let’s get rid of it.
1 parent c6e1721 commit e1fda5c

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ public final class Player implements PlaybackListener, Listener {
160160
public static final String RESUME_PLAYBACK = "resume_playback";
161161
public static final String PLAY_WHEN_READY = "play_when_ready";
162162
public static final String PLAYER_TYPE = "player_type";
163-
public static final String IS_MUTED = "is_muted";
164163

165164
/*//////////////////////////////////////////////////////////////////////////
166165
// Time constants
@@ -378,7 +377,6 @@ public void handleIntent(@NonNull final Intent intent) {
378377
final boolean samePlayQueue = playQueue != null && playQueue.equalStreamsAndIndex(newQueue);
379378
final int repeatMode = intent.getIntExtra(REPEAT_MODE, getRepeatMode());
380379
final boolean playWhenReady = intent.getBooleanExtra(PLAY_WHEN_READY, true);
381-
final boolean isMuted = intent.getBooleanExtra(IS_MUTED, isMuted());
382380

383381
/*
384382
* TODO As seen in #7427 this does not work:
@@ -436,27 +434,27 @@ public void handleIntent(@NonNull final Intent intent) {
436434
state.getProgressMillis());
437435
}
438436
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
439-
playbackSkipSilence, playWhenReady, isMuted);
437+
playbackSkipSilence, playWhenReady);
440438
},
441439
error -> {
442440
if (DEBUG) {
443441
Log.w(TAG, "Failed to start playback", error);
444442
}
445443
// In case any error we can start playback without history
446444
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
447-
playbackSkipSilence, playWhenReady, isMuted);
445+
playbackSkipSilence, playWhenReady);
448446
},
449447
() -> {
450448
// Completed but not found in history
451449
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
452-
playbackSkipSilence, playWhenReady, isMuted);
450+
playbackSkipSilence, playWhenReady);
453451
}
454452
));
455453
} else {
456454
// Good to go...
457455
// In a case of equal PlayQueues we can re-init old one but only when it is disposed
458456
initPlayback(samePlayQueue ? playQueue : newQueue, repeatMode, playbackSpeed,
459-
playbackPitch, playbackSkipSilence, playWhenReady, isMuted);
457+
playbackPitch, playbackSkipSilence, playWhenReady);
460458
}
461459

462460
if (oldPlayerType != playerType && playQueue != null) {
@@ -506,8 +504,7 @@ private void initPlayback(@NonNull final PlayQueue queue,
506504
final float playbackSpeed,
507505
final float playbackPitch,
508506
final boolean playbackSkipSilence,
509-
final boolean playOnReady,
510-
final boolean isMuted) {
507+
final boolean playOnReady) {
511508
destroyPlayer();
512509
initPlayer(playOnReady);
513510
setRepeatMode(repeatMode);
@@ -519,7 +516,7 @@ private void initPlayback(@NonNull final PlayQueue queue,
519516

520517
UIs.call(PlayerUi::initPlayback);
521518

522-
simpleExoPlayer.setVolume(isMuted ? 0 : 1);
519+
simpleExoPlayer.setVolume(isMuted() ? 0 : 1);
523520
notifyQueueUpdateToListeners();
524521
}
525522

0 commit comments

Comments
 (0)