Remove deprecated Player.seekToNextWindow()

Use `Player.seekToNextMediaItem()` instead.
This commit is contained in:
Gaëtan Muller 2025-02-07 14:37:52 +01:00 committed by tonihei
parent 2644409801
commit 0a648200ba
7 changed files with 3 additions and 58 deletions

View File

@ -182,15 +182,6 @@ public abstract class BasePlayer implements Player {
return getNextMediaItemIndex() != C.INDEX_UNSET;
}
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated
@Override
public final void seekToNextWindow() {
seekToNextMediaItem();
}
@Override
public final void seekToNextMediaItem() {
seekToNextMediaItemInternal(Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM);

View File

@ -376,18 +376,6 @@ public class ForwardingPlayer implements Player {
return player.hasNextMediaItem();
}
/**
* Calls {@link Player#seekToNextWindow()} on the delegate.
*
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void seekToNextWindow() {
player.seekToNextWindow();
}
/** Calls {@link Player#seekToNextMediaItem()} on the delegate. */
@Override
public void seekToNextMediaItem() {

View File

@ -2709,13 +2709,6 @@ public interface Player {
*/
boolean hasNextMediaItem();
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi
@Deprecated
void seekToNextWindow();
/**
* Seeks to the default position of the next {@link MediaItem}, which may depend on the current
* repeat mode and whether shuffle mode is enabled. Does nothing if {@link #hasNextMediaItem()} is

View File

@ -31,12 +31,12 @@ public class PlayerTest {
* This test picks a method on the {@link Player} interface that is known will never be
* stabilised, and asserts that it is required to be implemented (therefore enforcing that {@link
* Player} is unstable-for-implementors). If this test fails because the {@link
* Player#seekToNextWindow()} method is removed, it should be replaced with an equivalent
* Player#getCurrentWindowIndex()} method is removed, it should be replaced with an equivalent
* unstable, unimplemented method.
*/
@Test
public void testAtLeastOneUnstableUnimplementedMethodExists() throws Exception {
Method seekToNextWindowMethod = Player.class.getMethod("seekToNextWindow");
assertThat(seekToNextWindowMethod.isDefault()).isFalse();
Method getCurrentWindowIndexMethod = Player.class.getMethod("getCurrentWindowIndex");
assertThat(getCurrentWindowIndexMethod.isDefault()).isFalse();
}
}

View File

@ -1565,16 +1565,6 @@ public class MediaController implements Player {
impl.seekToPreviousMediaItem();
}
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi
@Deprecated
@Override
public final void seekToNextWindow() {
seekToNextMediaItem();
}
/**
* {@inheritDoc}
*

View File

@ -630,14 +630,6 @@ import java.util.List;
return super.hasNextMediaItem();
}
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated
@Override
public void seekToNextWindow() {
verifyApplicationThread();
super.seekToNextWindow();
}
@Override
public void seekToPreviousMediaItem() {
verifyApplicationThread();

View File

@ -1090,15 +1090,6 @@ public class MockPlayer implements Player {
throw new UnsupportedOperationException();
}
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated
@Override
public void seekToNextWindow() {
throw new UnsupportedOperationException();
}
@Override
public void seekToPreviousMediaItem() {
checkNotNull(conditionVariables.get(METHOD_SEEK_TO_PREVIOUS_MEDIA_ITEM)).open();