Add @deprecated javadoc to all @Deprecated @Override methods

This ensures the 'use X instead' message is easily visible in the
generated HTML for the overriding method. Currently it's not, e.g.:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/BasePlayer.html#getCurrentWindowIndex()

#minor-release

PiperOrigin-RevId: 452002224
This commit is contained in:
ibaker 2022-05-31 10:09:10 +00:00 committed by Marc Baechinger
parent 87ab96d352
commit b8ca5b8951
10 changed files with 301 additions and 20 deletions

View File

@ -458,6 +458,11 @@ public final class CastPlayer extends BasePlayer {
stop(/* reset= */ false); stop(/* reset= */ false);
} }
/**
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@Deprecated @Deprecated
@Override @Override
public void stop(boolean reset) { public void stop(boolean reset) {

View File

@ -143,12 +143,18 @@ public abstract class BasePlayer implements Player {
seekToOffset(getSeekForwardIncrement()); seekToOffset(getSeekForwardIncrement());
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean hasPrevious() { public final boolean hasPrevious() {
return hasPreviousMediaItem(); return hasPreviousMediaItem();
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean hasPreviousWindow() { public final boolean hasPreviousWindow() {
@ -160,12 +166,18 @@ public abstract class BasePlayer implements Player {
return getPreviousMediaItemIndex() != C.INDEX_UNSET; return getPreviousMediaItemIndex() != C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final void previous() { public final void previous() {
seekToPreviousMediaItem(); seekToPreviousMediaItem();
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final void seekToPreviousWindow() { public final void seekToPreviousWindow() {
@ -198,12 +210,18 @@ public abstract class BasePlayer implements Player {
} }
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean hasNext() { public final boolean hasNext() {
return hasNextMediaItem(); return hasNextMediaItem();
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean hasNextWindow() { public final boolean hasNextWindow() {
@ -215,12 +233,18 @@ public abstract class BasePlayer implements Player {
return getNextMediaItemIndex() != C.INDEX_UNSET; return getNextMediaItemIndex() != C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final void next() { public final void next() {
seekToNextMediaItem(); seekToNextMediaItem();
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final void seekToNextWindow() { public final void seekToNextWindow() {
@ -253,12 +277,18 @@ public abstract class BasePlayer implements Player {
setPlaybackParameters(getPlaybackParameters().withSpeed(speed)); setPlaybackParameters(getPlaybackParameters().withSpeed(speed));
} }
/**
* @deprecated Use {@link #getCurrentMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final int getCurrentWindowIndex() { public final int getCurrentWindowIndex() {
return getCurrentMediaItemIndex(); return getCurrentMediaItemIndex();
} }
/**
* @deprecated Use {@link #getNextMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final int getNextWindowIndex() { public final int getNextWindowIndex() {
@ -274,6 +304,9 @@ public abstract class BasePlayer implements Player {
getCurrentMediaItemIndex(), getRepeatModeForNavigation(), getShuffleModeEnabled()); getCurrentMediaItemIndex(), getRepeatModeForNavigation(), getShuffleModeEnabled());
} }
/**
* @deprecated Use {@link #getPreviousMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final int getPreviousWindowIndex() { public final int getPreviousWindowIndex() {
@ -326,6 +359,9 @@ public abstract class BasePlayer implements Player {
: duration == 0 ? 100 : Util.constrainValue((int) ((position * 100) / duration), 0, 100); : duration == 0 ? 100 : Util.constrainValue((int) ((position * 100) / duration), 0, 100);
} }
/**
* @deprecated Use {@link #isCurrentMediaItemDynamic()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean isCurrentWindowDynamic() { public final boolean isCurrentWindowDynamic() {
@ -338,6 +374,9 @@ public abstract class BasePlayer implements Player {
return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isDynamic; return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isDynamic;
} }
/**
* @deprecated Use {@link #isCurrentMediaItemLive()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean isCurrentWindowLive() { public final boolean isCurrentWindowLive() {
@ -364,6 +403,9 @@ public abstract class BasePlayer implements Player {
return window.getCurrentUnixTimeMs() - window.windowStartTimeMs - getContentPosition(); return window.getCurrentUnixTimeMs() - window.windowStartTimeMs - getContentPosition();
} }
/**
* @deprecated Use {@link #isCurrentMediaItemSeekable()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public final boolean isCurrentWindowSeekable() { public final boolean isCurrentWindowSeekable() {

View File

@ -299,7 +299,11 @@ public class ForwardingPlayer implements Player {
player.seekForward(); player.seekForward();
} }
/** Calls {@link Player#hasPrevious()} on the delegate and returns the result. */ /**
* Calls {@link Player#hasPrevious()} on the delegate and returns the result.
*
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -307,7 +311,11 @@ public class ForwardingPlayer implements Player {
return player.hasPrevious(); return player.hasPrevious();
} }
/** Calls {@link Player#hasPreviousWindow()} on the delegate and returns the result. */ /**
* Calls {@link Player#hasPreviousWindow()} on the delegate and returns the result.
*
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -321,7 +329,11 @@ public class ForwardingPlayer implements Player {
return player.hasPreviousMediaItem(); return player.hasPreviousMediaItem();
} }
/** Calls {@link Player#previous()} on the delegate. */ /**
* Calls {@link Player#previous()} on the delegate.
*
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -329,7 +341,11 @@ public class ForwardingPlayer implements Player {
player.previous(); player.previous();
} }
/** Calls {@link Player#seekToPreviousWindow()} on the delegate. */ /**
* Calls {@link Player#seekToPreviousWindow()} on the delegate.
*
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -355,7 +371,11 @@ public class ForwardingPlayer implements Player {
return player.getMaxSeekToPreviousPosition(); return player.getMaxSeekToPreviousPosition();
} }
/** Calls {@link Player#hasNext()} on the delegate and returns the result. */ /**
* Calls {@link Player#hasNext()} on the delegate and returns the result.
*
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -363,7 +383,11 @@ public class ForwardingPlayer implements Player {
return player.hasNext(); return player.hasNext();
} }
/** Calls {@link Player#hasNextWindow()} on the delegate and returns the result. */ /**
* Calls {@link Player#hasNextWindow()} on the delegate and returns the result.
*
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -377,7 +401,11 @@ public class ForwardingPlayer implements Player {
return player.hasNextMediaItem(); return player.hasNextMediaItem();
} }
/** Calls {@link Player#next()} on the delegate. */ /**
* Calls {@link Player#next()} on the delegate.
*
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -385,7 +413,11 @@ public class ForwardingPlayer implements Player {
player.next(); player.next();
} }
/** Calls {@link Player#seekToNextWindow()} on the delegate. */ /**
* Calls {@link Player#seekToNextWindow()} on the delegate.
*
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -429,7 +461,13 @@ public class ForwardingPlayer implements Player {
player.stop(); player.stop();
} }
/** Calls {@link Player#stop(boolean)} on the delegate. */ /**
* Calls {@link Player#stop(boolean)} on the delegate.
*
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -498,7 +536,11 @@ public class ForwardingPlayer implements Player {
return player.getCurrentPeriodIndex(); return player.getCurrentPeriodIndex();
} }
/** Calls {@link Player#getCurrentWindowIndex()} on the delegate and returns the result. */ /**
* Calls {@link Player#getCurrentWindowIndex()} on the delegate and returns the result.
*
* @deprecated Use {@link #getCurrentMediaItemIndex()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -512,7 +554,11 @@ public class ForwardingPlayer implements Player {
return player.getCurrentMediaItemIndex(); return player.getCurrentMediaItemIndex();
} }
/** Calls {@link Player#getNextWindowIndex()} on the delegate and returns the result. */ /**
* Calls {@link Player#getNextWindowIndex()} on the delegate and returns the result.
*
* @deprecated Use {@link #getNextMediaItemIndex()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -526,7 +572,11 @@ public class ForwardingPlayer implements Player {
return player.getNextMediaItemIndex(); return player.getNextMediaItemIndex();
} }
/** Calls {@link Player#getPreviousWindowIndex()} on the delegate and returns the result. */ /**
* Calls {@link Player#getPreviousWindowIndex()} on the delegate and returns the result.
*
* @deprecated Use {@link #getPreviousMediaItemIndex()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -589,7 +639,11 @@ public class ForwardingPlayer implements Player {
return player.getTotalBufferedDuration(); return player.getTotalBufferedDuration();
} }
/** Calls {@link Player#isCurrentWindowDynamic()} on the delegate and returns the result. */ /**
* Calls {@link Player#isCurrentWindowDynamic()} on the delegate and returns the result.
*
* @deprecated Use {@link #isCurrentMediaItemDynamic()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -603,7 +657,11 @@ public class ForwardingPlayer implements Player {
return player.isCurrentMediaItemDynamic(); return player.isCurrentMediaItemDynamic();
} }
/** Calls {@link Player#isCurrentWindowLive()} on the delegate and returns the result. */ /**
* Calls {@link Player#isCurrentWindowLive()} on the delegate and returns the result.
*
* @deprecated Use {@link #isCurrentMediaItemLive()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override
@ -623,7 +681,11 @@ public class ForwardingPlayer implements Player {
return player.getCurrentLiveOffset(); return player.getCurrentLiveOffset();
} }
/** Calls {@link Player#isCurrentWindowSeekable()} on the delegate and returns the result. */ /**
* Calls {@link Player#isCurrentWindowSeekable()} on the delegate and returns the result.
*
* @deprecated Use {@link #isCurrentMediaItemSeekable()} instead.
*/
@SuppressWarnings("deprecation") // Forwarding to deprecated method @SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated @Deprecated
@Override @Override

View File

@ -481,11 +481,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
} }
/** /**
* Sets a content type {@link Predicate}. If a content type is rejected by the predicate then a * @deprecated Use {@link CronetDataSource.Factory#setContentTypePredicate(Predicate)} instead.
* {@link HttpDataSource.InvalidContentTypeException} is thrown from {@link #open(DataSpec)}.
*
* @param contentTypePredicate The content type {@link Predicate}, or {@code null} to clear a
* predicate that was previously set.
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated

View File

@ -33,6 +33,7 @@ import androidx.media3.common.Format;
import androidx.media3.common.MediaItem; import androidx.media3.common.MediaItem;
import androidx.media3.common.MediaMetadata; import androidx.media3.common.MediaMetadata;
import androidx.media3.common.PlaybackParameters; import androidx.media3.common.PlaybackParameters;
import androidx.media3.common.Player;
import androidx.media3.common.PriorityTaskManager; import androidx.media3.common.PriorityTaskManager;
import androidx.media3.common.Timeline; import androidx.media3.common.Timeline;
import androidx.media3.common.TrackSelectionParameters; import androidx.media3.common.TrackSelectionParameters;
@ -426,24 +427,44 @@ public class SimpleExoPlayer extends BasePlayer
return player.experimentalIsSleepingForOffload(); return player.experimentalIsSleepingForOffload();
} }
/**
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
* interface.
*/
@Deprecated
@Override @Override
@Nullable @Nullable
public AudioComponent getAudioComponent() { public AudioComponent getAudioComponent() {
return this; return this;
} }
/**
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
* interface.
*/
@Deprecated
@Override @Override
@Nullable @Nullable
public VideoComponent getVideoComponent() { public VideoComponent getVideoComponent() {
return this; return this;
} }
/**
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
* interface.
*/
@Deprecated
@Override @Override
@Nullable @Nullable
public TextComponent getTextComponent() { public TextComponent getTextComponent() {
return this; return this;
} }
/**
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
* interface.
*/
@Deprecated
@Override @Override
@Nullable @Nullable
public DeviceComponent getDeviceComponent() { public DeviceComponent getDeviceComponent() {
@ -1003,6 +1024,11 @@ public class SimpleExoPlayer extends BasePlayer
player.stop(); player.stop();
} }
/**
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@Deprecated @Deprecated
@Override @Override
public void stop(boolean reset) { public void stop(boolean reset) {
@ -1046,12 +1072,20 @@ public class SimpleExoPlayer extends BasePlayer
return player.getTrackSelector(); return player.getTrackSelector();
} }
/**
* @deprecated Use {@link #getCurrentTracks()}.
*/
@Deprecated
@Override @Override
public TrackGroupArray getCurrentTrackGroups() { public TrackGroupArray getCurrentTrackGroups() {
blockUntilConstructorFinished(); blockUntilConstructorFinished();
return player.getCurrentTrackGroups(); return player.getCurrentTrackGroups();
} }
/**
* @deprecated Use {@link #getCurrentTracks()}.
*/
@Deprecated
@Override @Override
public TrackSelectionArray getCurrentTrackSelections() { public TrackSelectionArray getCurrentTrackSelections() {
blockUntilConstructorFinished(); blockUntilConstructorFinished();
@ -1166,6 +1200,9 @@ public class SimpleExoPlayer extends BasePlayer
return player.getContentBufferedPosition(); return player.getContentBufferedPosition();
} }
/**
* @deprecated Use {@link #setWakeMode(int)} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void setHandleWakeLock(boolean handleWakeLock) { public void setHandleWakeLock(boolean handleWakeLock) {

View File

@ -616,6 +616,9 @@ public class DefaultTrackSelector extends MappingTrackSelector {
return this; return this;
} }
/**
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
*/
@Override @Override
@Deprecated @Deprecated
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")

View File

@ -401,6 +401,11 @@ public class MediaController implements Player {
impl.stop(); impl.stop();
} }
/**
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1185,6 +1190,9 @@ public class MediaController implements Player {
impl.moveMediaItems(fromIndex, toIndex, newIndex); impl.moveMediaItems(fromIndex, toIndex, newIndex);
} }
/**
* @deprecated Use {@link #isCurrentMediaItemDynamic()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1199,6 +1207,9 @@ public class MediaController implements Player {
return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isDynamic; return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isDynamic;
} }
/**
* @deprecated Use {@link #isCurrentMediaItemLive()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1213,6 +1224,9 @@ public class MediaController implements Player {
return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isLive(); return !timeline.isEmpty() && timeline.getWindow(getCurrentMediaItemIndex(), window).isLive();
} }
/**
* @deprecated Use {@link #isCurrentMediaItemSeekable()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1262,6 +1276,9 @@ public class MediaController implements Player {
return isConnected() ? impl.getCurrentPeriodIndex() : C.INDEX_UNSET; return isConnected() ? impl.getCurrentPeriodIndex() : C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #getCurrentMediaItemIndex()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1275,6 +1292,9 @@ public class MediaController implements Player {
return isConnected() ? impl.getCurrentMediaItemIndex() : C.INDEX_UNSET; return isConnected() ? impl.getCurrentMediaItemIndex() : C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #getPreviousMediaItemIndex()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1295,6 +1315,9 @@ public class MediaController implements Player {
return isConnected() ? impl.getPreviousMediaItemIndex() : C.INDEX_UNSET; return isConnected() ? impl.getPreviousMediaItemIndex() : C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #getNextMediaItemIndex()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1315,6 +1338,9 @@ public class MediaController implements Player {
return isConnected() ? impl.getNextMediaItemIndex() : C.INDEX_UNSET; return isConnected() ? impl.getNextMediaItemIndex() : C.INDEX_UNSET;
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1322,6 +1348,9 @@ public class MediaController implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1329,6 +1358,9 @@ public class MediaController implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1336,6 +1368,9 @@ public class MediaController implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1355,6 +1390,9 @@ public class MediaController implements Player {
return isConnected() && impl.hasNextMediaItem(); return isConnected() && impl.hasNextMediaItem();
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1362,6 +1400,9 @@ public class MediaController implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1369,6 +1410,9 @@ public class MediaController implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
@ -1392,6 +1436,9 @@ public class MediaController implements Player {
impl.seekToPreviousMediaItem(); impl.seekToPreviousMediaItem();
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override

View File

@ -310,6 +310,11 @@ public class MockPlayer implements Player {
checkNotNull(conditionVariables.get(METHOD_STOP)).open(); checkNotNull(conditionVariables.get(METHOD_STOP)).open();
} }
/**
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@Deprecated @Deprecated
@Override @Override
public void stop(boolean reset) { public void stop(boolean reset) {
@ -758,6 +763,9 @@ public class MockPlayer implements Player {
checkNotNull(conditionVariables.get(METHOD_SET_PLAYLIST_METADATA)).open(); checkNotNull(conditionVariables.get(METHOD_SET_PLAYLIST_METADATA)).open();
} }
/**
* @deprecated Use {@link #isCurrentMediaItemDynamic()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowDynamic() { public boolean isCurrentWindowDynamic() {
@ -769,6 +777,9 @@ public class MockPlayer implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #isCurrentMediaItemLive()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowLive() { public boolean isCurrentWindowLive() {
@ -780,6 +791,9 @@ public class MockPlayer implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #isCurrentMediaItemSeekable()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowSeekable() { public boolean isCurrentWindowSeekable() {
@ -815,6 +829,9 @@ public class MockPlayer implements Player {
return currentPeriodIndex; return currentPeriodIndex;
} }
/**
* @deprecated Use {@link #getCurrentMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public int getCurrentWindowIndex() { public int getCurrentWindowIndex() {
@ -826,6 +843,9 @@ public class MockPlayer implements Player {
return currentMediaItemIndex; return currentMediaItemIndex;
} }
/**
* @deprecated Use {@link #getPreviousMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public int getPreviousWindowIndex() { public int getPreviousWindowIndex() {
@ -837,6 +857,9 @@ public class MockPlayer implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #getNextMediaItemIndex()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public int getNextWindowIndex() { public int getNextWindowIndex() {
@ -912,24 +935,36 @@ public class MockPlayer implements Player {
checkNotNull(conditionVariables.get(METHOD_MOVE_MEDIA_ITEMS)).open(); checkNotNull(conditionVariables.get(METHOD_MOVE_MEDIA_ITEMS)).open();
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean hasPrevious() { public boolean hasPrevious() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean hasNext() { public boolean hasNext() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean hasPreviousWindow() { public boolean hasPreviousWindow() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #hasNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public boolean hasNextWindow() { public boolean hasNextWindow() {
@ -946,24 +981,36 @@ public class MockPlayer implements Player {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void previous() { public void previous() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void next() { public void next() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToPreviousMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void seekToPreviousWindow() { public void seekToPreviousWindow() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #seekToNextMediaItem()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void seekToNextWindow() { public void seekToNextWindow() {

View File

@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
import androidx.media3.common.AudioAttributes; import androidx.media3.common.AudioAttributes;
import androidx.media3.common.AuxEffectInfo; import androidx.media3.common.AuxEffectInfo;
import androidx.media3.common.Format; import androidx.media3.common.Format;
import androidx.media3.common.Player;
import androidx.media3.common.PriorityTaskManager; import androidx.media3.common.PriorityTaskManager;
import androidx.media3.common.util.Clock; import androidx.media3.common.util.Clock;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
@ -47,24 +48,40 @@ import java.util.List;
@UnstableApi @UnstableApi
public class StubExoPlayer extends StubPlayer implements ExoPlayer { public class StubExoPlayer extends StubPlayer implements ExoPlayer {
/**
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
* interface.
*/
@Override @Override
@Deprecated @Deprecated
public AudioComponent getAudioComponent() { public AudioComponent getAudioComponent() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
* interface.
*/
@Override @Override
@Deprecated @Deprecated
public VideoComponent getVideoComponent() { public VideoComponent getVideoComponent() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
* interface.
*/
@Override @Override
@Deprecated @Deprecated
public TextComponent getTextComponent() { public TextComponent getTextComponent() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
* interface.
*/
@Override @Override
@Deprecated @Deprecated
public DeviceComponent getDeviceComponent() { public DeviceComponent getDeviceComponent() {
@ -111,18 +128,27 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #prepare()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void retry() { public void retry() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #setMediaSource(MediaSource)} and {@link #prepare()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void prepare(MediaSource mediaSource) { public void prepare(MediaSource mediaSource) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #setMediaSource(MediaSource, boolean)} and {@link #prepare()} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState) { public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState) {
@ -296,11 +322,19 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #getCurrentTracks()}.
*/
@Deprecated
@Override @Override
public TrackGroupArray getCurrentTrackGroups() { public TrackGroupArray getCurrentTrackGroups() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #getCurrentTracks()}.
*/
@Deprecated
@Override @Override
public TrackSelectionArray getCurrentTrackSelections() { public TrackSelectionArray getCurrentTrackSelections() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
@ -350,6 +384,9 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #setWakeMode(int)} instead.
*/
@Deprecated @Deprecated
@Override @Override
public void setHandleWakeLock(boolean handleWakeLock) { public void setHandleWakeLock(boolean handleWakeLock) {

View File

@ -179,6 +179,11 @@ public class StubPlayer extends BasePlayer {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* @deprecated Use {@link #stop()} and {@link #clearMediaItems()} (if {@code reset} is true) or
* just {@link #stop()} (if {@code reset} is false). Any player error will be cleared when
* {@link #prepare() re-preparing} the player.
*/
@Deprecated @Deprecated
@Override @Override
public void stop(boolean reset) { public void stop(boolean reset) {