mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove deprecated Player.seekToNextWindow()
Use `Player.seekToNextMediaItem()` instead.
This commit is contained in:
parent
2644409801
commit
0a648200ba
@ -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);
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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}
|
||||
*
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user