mirror of
https://github.com/androidx/media.git
synced 2025-05-07 15:40:37 +08:00
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
d699fb5dd9
commit
f5d8efbf40
@ -2,6 +2,10 @@
|
||||
|
||||
### dev-v2 (not yet released)
|
||||
|
||||
* Core Library:
|
||||
* 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).
|
||||
* Video:
|
||||
* Fix `IncorrectContextUseViolation` strict mode warning on Android 11
|
||||
([#8246](https://github.com/google/ExoPlayer/pull/8246)).
|
||||
|
@ -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.
|
||||
@ -1582,6 +1592,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
player.setForegroundMode(foregroundMode);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void stop(boolean reset) {
|
||||
verifyApplicationThread();
|
||||
@ -1790,6 +1801,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.
|
||||
@ -1797,6 +1809,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