mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove deprecated Player.next()
Use `Player.seekToNextMediaItem()` instead.
This commit is contained in:
parent
521871b9d5
commit
72884c3bf3
@ -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.
|
||||
*/
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -2716,13 +2716,6 @@ public interface Player {
|
||||
*/
|
||||
boolean hasNextMediaItem();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #seekToNextMediaItem()} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
void next();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #seekToNextMediaItem()} instead.
|
||||
*/
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user