Add @Deprecated
to SEP methods that override deprecated methods
Without this annotation it seems that `SimpleExoPlayer` effectively 'un-deprecates' the method, specifically: * A usage of these methods isn't flagged by Android Studio if the declared type is `SimpleExoPlayer` (up-casting to e.g. `ExoPlayer.VideoComponent` results in the warning showing up). * The `SimpleExoPlayer` javadoc doesn't mention this method is deprecated: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/SimpleExoPlayer.html#addVideoListener(com.google.android.exoplayer2.video.VideoListener) * The Metalava API output for `SimpleExoPlayer` doesn't show these methods as deprecated. PiperOrigin-RevId: 382756174
This commit is contained in:
parent
6035932fa3
commit
6e43ea97e7
@ -21,6 +21,9 @@
|
||||
cause of the failure in order to simplify error handling.
|
||||
* Add `@FallbackType` to `LoadErrorHandlingPolicy` to support
|
||||
customization of the exclusion duration for locations and tracks.
|
||||
* Explicitly mark several methods on `SimpleExoPlayer` as `@Deprecated`.
|
||||
These methods are all overrides and are already deprecated on `Player`
|
||||
and the respective `ExoPlayer` component classes (since 2.14.0).
|
||||
* Remove deprecated symbols:
|
||||
* Remove `Player.getPlaybackError`. Use `Player.getPlayerError` instead.
|
||||
* Remove `Player.getCurrentTag`. Use `Player.getCurrentMediaItem` and
|
||||
|
@ -963,6 +963,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
player.removeAudioOffloadListener(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addAudioListener(AudioListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -970,6 +971,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
audioListeners.add(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeAudioListener(AudioListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1175,6 +1177,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
return audioDecoderCounters;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addVideoListener(VideoListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1182,6 +1185,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
videoListeners.add(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeVideoListener(VideoListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1236,6 +1240,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
.send();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addTextOutput(TextOutput listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1243,6 +1248,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
textOutputs.add(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeTextOutput(TextOutput listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1255,6 +1261,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
return currentCues;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addMetadataOutput(MetadataOutput listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1262,6 +1269,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
metadataOutputs.add(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeMetadataOutput(MetadataOutput listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1297,6 +1305,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
addListener(eventListener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addListener(Player.EventListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1316,6 +1325,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
removeListener(eventListener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeListener(Player.EventListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1606,6 +1616,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
player.setForegroundMode(foregroundMode);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void stop(boolean reset) {
|
||||
verifyApplicationThread();
|
||||
@ -1824,6 +1835,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addDeviceListener(DeviceListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
@ -1831,6 +1843,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
deviceListeners.add(listener);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removeDeviceListener(DeviceListener listener) {
|
||||
// Don't verify application thread. We allow calls to this method from any thread.
|
||||
|
Loading…
x
Reference in New Issue
Block a user