mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove deprecated Player.hasNext()
and Player.hasNextWindow()
Use `Player.hasNextMediaItem()` instead.
This commit is contained in:
parent
72c85aa483
commit
521871b9d5
@ -186,24 +186,6 @@ public abstract class BasePlayer implements Player {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public final boolean hasNext() {
|
||||
return hasNextMediaItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public final boolean hasNextWindow() {
|
||||
return hasNextMediaItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean hasNextMediaItem() {
|
||||
return getNextMediaItemIndex() != C.INDEX_UNSET;
|
||||
|
@ -382,30 +382,6 @@ public class ForwardingPlayer implements Player {
|
||||
return player.getMaxSeekToPreviousPosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls {@link Player#hasNext()} on the delegate and returns the result.
|
||||
*
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return player.hasNext();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls {@link Player#hasNextWindow()} on the delegate and returns the result.
|
||||
*
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNextWindow() {
|
||||
return player.hasNextWindow();
|
||||
}
|
||||
|
||||
/** Calls {@link Player#hasNextMediaItem()} on the delegate and returns the result. */
|
||||
@Override
|
||||
public boolean hasNextMediaItem() {
|
||||
|
@ -2703,20 +2703,6 @@ public interface Player {
|
||||
*/
|
||||
void seekToPrevious();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
boolean hasNext();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
boolean hasNextWindow();
|
||||
|
||||
/**
|
||||
* Returns whether a next {@link MediaItem} exists, which may depend on the current repeat mode
|
||||
* and whether shuffle mode is enabled.
|
||||
|
@ -1537,26 +1537,6 @@ public class MediaController implements Player {
|
||||
return isConnected() ? impl.getNextMediaItemIndex() : C.INDEX_UNSET;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@Override
|
||||
public final boolean hasNext() {
|
||||
return hasNextMediaItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@Override
|
||||
public final boolean hasNextWindow() {
|
||||
return hasNextMediaItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean hasPreviousMediaItem() {
|
||||
verifyApplicationThread();
|
||||
|
@ -618,22 +618,6 @@ import java.util.List;
|
||||
super.replaceMediaItems(fromIndex, toIndex, mediaItems);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
verifyApplicationThread();
|
||||
return super.hasNext();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNextWindow() {
|
||||
verifyApplicationThread();
|
||||
return super.hasNextWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPreviousMediaItem() {
|
||||
verifyApplicationThread();
|
||||
|
@ -1080,24 +1080,6 @@ public class MockPlayer implements Player {
|
||||
checkNotNull(conditionVariables.get(METHOD_REPLACE_MEDIA_ITEMS)).open();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #hasNextMediaItem()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNextWindow() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPreviousMediaItem() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
Loading…
x
Reference in New Issue
Block a user