Remove deprecated Player.next()

Use `Player.seekToNextMediaItem()` instead.
This commit is contained in:
Gaëtan Muller 2025-02-07 14:28:47 +01:00 committed by tonihei
parent 521871b9d5
commit 72884c3bf3
7 changed files with 5 additions and 59 deletions

View File

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

View File

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

View File

@ -2716,13 +2716,6 @@ public interface Player {
*/
boolean hasNextMediaItem();
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi
@Deprecated
void next();
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/

View File

@ -30,12 +30,13 @@ 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#next()}
* method is removed, it should be replaced with an equivalent unstable, unimplemented method.
* Player} is unstable-for-implementors). If this test fails because the {@link
* Player#seekToNextWindow()} method is removed, it should be replaced with an equivalent
* unstable, unimplemented method.
*/
@Test
public void testAtLeastOneUnstableUnimplementedMethodExists() throws Exception {
Method nextMethod = Player.class.getMethod("next");
assertThat(nextMethod.isDefault()).isFalse();
Method seekToNextWindowMethod = Player.class.getMethod("seekToNextWindow");
assertThat(seekToNextWindowMethod.isDefault()).isFalse();
}
}

View File

@ -1549,16 +1549,6 @@ public class MediaController implements Player {
return isConnected() && impl.hasNextMediaItem();
}
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi
@Deprecated
@Override
public final void next() {
seekToNextMediaItem();
}
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/

View File

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

View File

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