Fixes for some minor misc issues

- Unnecessary deprecation suppressions
- Dead code
- Broken Javadoc

PiperOrigin-RevId: 409357884
This commit is contained in:
olly 2021-11-12 10:18:26 +00:00 committed by Ian Baker
parent 3b11822fa1
commit c046f40fd0
9 changed files with 5 additions and 20 deletions

View File

@ -392,7 +392,6 @@ public class CastPlayerTest {
assertThat(mediaQueueItems[1].getMedia().getContentId()).isEqualTo(uri2);
}
@SuppressWarnings("deprecation") // Verifies deprecated callback being called correctly.
@Test
public void setMediaItems_replaceExistingPlaylist_notifiesMediaItemTransition() {
List<MediaItem> firstPlaylist = new ArrayList<>();

View File

@ -366,7 +366,6 @@ public final class Cue implements Bundleable {
* @deprecated Use {@link Builder}.
*/
@UnstableApi
@SuppressWarnings("deprecation")
@Deprecated
public Cue(
CharSequence text,

View File

@ -265,7 +265,6 @@ public class DefaultLoadControl implements LoadControl {
private boolean isLoading;
/** Constructs a new instance, using the {@code DEFAULT_*} constants defined in this class. */
@SuppressWarnings("deprecation")
public DefaultLoadControl() {
this(
new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE),

View File

@ -407,7 +407,6 @@ public class SimpleExoPlayer extends BasePlayer
/** @deprecated Use the {@link ExoPlayer.Builder}. */
@Deprecated
@SuppressWarnings("deprecation")
protected SimpleExoPlayer(
Context context,
RenderersFactory renderersFactory,
@ -439,7 +438,6 @@ public class SimpleExoPlayer extends BasePlayer
}
/** @param builder The {@link ExoPlayer.Builder} to obtain all construction parameters. */
@SuppressWarnings("deprecation")
/* package */ SimpleExoPlayer(ExoPlayer.Builder builder) {
constructorFinished = new ConditionVariable();
try {

View File

@ -52,9 +52,8 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
/**
* A class that tests whether {@link MediaController.Listener#onSurfaceSizeChanged(int, int)} is
* called when calling {@link MediaController#setVideoSurface(Surface)} and other surface related
* methods.
* A class that tests whether {@link Player.Listener#onSurfaceSizeChanged(int, int)} is called when
* calling {@link MediaController#setVideoSurface(Surface)} and other surface related methods.
*/
@RunWith(Parameterized.class)
@LargeTest

View File

@ -96,14 +96,8 @@ public class RemoteMediaBrowser extends RemoteMediaController {
// Non-public methods
////////////////////////////////////////////////////////////////////////////////
/**
* Create a {@link MediaBrowser} in the client app. Should be used after successful connection
* through {@link #connect()}.
*
* @param connectionHints connection hints
* @param waitForConnection true if this method needs to wait for the connection,
*/
void create(SessionToken token, Bundle connectionHints, boolean waitForConnection)
@Override
protected void create(SessionToken token, Bundle connectionHints, boolean waitForConnection)
throws RemoteException {
binder.create(
/* isBrowser= */ true, controllerId, token.toBundle(), connectionHints, waitForConnection);

View File

@ -340,7 +340,7 @@ public class RemoteMediaController {
* @param connectionHints connection hints
* @param waitForConnection true if this method needs to wait for the connection,
*/
void create(SessionToken token, Bundle connectionHints, boolean waitForConnection)
protected void create(SessionToken token, Bundle connectionHints, boolean waitForConnection)
throws RemoteException {
binder.create(
/* isBrowser= */ false, controllerId, token.toBundle(), connectionHints, waitForConnection);

View File

@ -1224,7 +1224,6 @@ public class PlayerControlView extends FrameLayout {
}
}
@SuppressWarnings("deprecation")
private void dispatchPlay(Player player) {
@State int state = player.getPlaybackState();
if (state == Player.STATE_IDLE) {

View File

@ -136,8 +136,6 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
return player.getPlaybackState() == Player.STATE_IDLE ? -1 : player.getCurrentPosition();
}
// Calls deprecated method to provide backwards compatibility.
@SuppressWarnings("deprecation")
@Override
public void play() {
if (player.getPlaybackState() == Player.STATE_IDLE) {