Commit 23d680a4 by ibaker Committed by Oliver Woodman

Suppress deprecation warnings in deprecated places

PiperOrigin-RevId: 320970814
parent f2055396
...@@ -243,6 +243,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource { ...@@ -243,6 +243,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor)} and {@link * @deprecated Use {@link #CronetDataSource(CronetEngine, Executor)} and {@link
* #setContentTypePredicate(Predicate)}. * #setContentTypePredicate(Predicate)}.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
public CronetDataSource( public CronetDataSource(
CronetEngine cronetEngine, CronetEngine cronetEngine,
...@@ -276,6 +277,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource { ...@@ -276,6 +277,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor, int, int, boolean, * @deprecated Use {@link #CronetDataSource(CronetEngine, Executor, int, int, boolean,
* RequestProperties)} and {@link #setContentTypePredicate(Predicate)}. * RequestProperties)} and {@link #setContentTypePredicate(Predicate)}.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
public CronetDataSource( public CronetDataSource(
CronetEngine cronetEngine, CronetEngine cronetEngine,
......
...@@ -421,6 +421,7 @@ import java.util.List; ...@@ -421,6 +421,7 @@ import java.util.List;
listener.onShuffleModeChanged(Utils.getShuffleMode(shuffleModeEnabled)); listener.onShuffleModeChanged(Utils.getShuffleMode(shuffleModeEnabled));
} }
@SuppressWarnings("deprecation")
private void handlePlaybackParametersChanged(PlaybackParameters playbackParameters) { private void handlePlaybackParametersChanged(PlaybackParameters playbackParameters) {
listener.onPlaybackSpeedChanged(playbackParameters.speed); listener.onPlaybackSpeedChanged(playbackParameters.speed);
} }
......
...@@ -119,6 +119,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource { ...@@ -119,6 +119,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #OkHttpDataSource(Call.Factory, String)} and {@link * @deprecated Use {@link #OkHttpDataSource(Call.Factory, String)} and {@link
* #setContentTypePredicate(Predicate)}. * #setContentTypePredicate(Predicate)}.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
public OkHttpDataSource( public OkHttpDataSource(
Call.Factory callFactory, Call.Factory callFactory,
......
...@@ -564,6 +564,7 @@ public final class C { ...@@ -564,6 +564,7 @@ public final class C {
// ) // )
/** @deprecated Use {@code Renderer.VideoScalingMode}. */ /** @deprecated Use {@code Renderer.VideoScalingMode}. */
@SuppressWarnings("deprecation")
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef(value = {VIDEO_SCALING_MODE_SCALE_TO_FIT, VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING}) @IntDef(value = {VIDEO_SCALING_MODE_SCALE_TO_FIT, VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING})
......
...@@ -1213,6 +1213,8 @@ public final class Format implements Parcelable { ...@@ -1213,6 +1213,8 @@ public final class Format implements Parcelable {
return new Builder().setId(id).setSampleMimeType(sampleMimeType).build(); return new Builder().setId(id).setSampleMimeType(sampleMimeType).build();
} }
// Some fields are deprecated but they're still assigned below.
@SuppressWarnings("deprecation")
/* package */ Format( /* package */ Format(
@Nullable String id, @Nullable String id,
@Nullable String label, @Nullable String label,
...@@ -1298,7 +1300,8 @@ public final class Format implements Parcelable { ...@@ -1298,7 +1300,8 @@ public final class Format implements Parcelable {
this.exoMediaCryptoType = exoMediaCryptoType; this.exoMediaCryptoType = exoMediaCryptoType;
} }
@SuppressWarnings("ResourceType") // Some fields are deprecated but they're still assigned below.
@SuppressWarnings({"ResourceType", "deprecation"})
/* package */ Format(Parcel in) { /* package */ Format(Parcel in) {
id = in.readString(); id = in.readString();
label = in.readString(); label = in.readString();
......
...@@ -302,6 +302,7 @@ public interface AudioSink { ...@@ -302,6 +302,7 @@ public interface AudioSink {
* @deprecated Use {@link #setPlaybackSpeed(float)} and {@link #setSkipSilenceEnabled(boolean)} * @deprecated Use {@link #setPlaybackSpeed(float)} and {@link #setSkipSilenceEnabled(boolean)}
* instead. * instead.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
void setPlaybackParameters(PlaybackParameters playbackParameters); void setPlaybackParameters(PlaybackParameters playbackParameters);
......
...@@ -86,6 +86,7 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -86,6 +86,7 @@ public final class DefaultAudioSink implements AudioSink {
* @deprecated Use {@link #applyPlaybackSpeed(float)} and {@link * @deprecated Use {@link #applyPlaybackSpeed(float)} and {@link
* #applySkipSilenceEnabled(boolean)} instead. * #applySkipSilenceEnabled(boolean)} instead.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
PlaybackParameters applyPlaybackParameters(PlaybackParameters playbackParameters); PlaybackParameters applyPlaybackParameters(PlaybackParameters playbackParameters);
......
...@@ -229,6 +229,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource { ...@@ -229,6 +229,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
} }
/** @deprecated Use {@link Factory} instead. */ /** @deprecated Use {@link Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
public SingleSampleMediaSource( public SingleSampleMediaSource(
Uri uri, Uri uri,
......
...@@ -150,6 +150,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou ...@@ -150,6 +150,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
* @deprecated Use {@link #DefaultHttpDataSource(String)} and {@link * @deprecated Use {@link #DefaultHttpDataSource(String)} and {@link
* #setContentTypePredicate(Predicate)}. * #setContentTypePredicate(Predicate)}.
*/ */
@SuppressWarnings("deprecation")
@Deprecated @Deprecated
public DefaultHttpDataSource(String userAgent, @Nullable Predicate<String> contentTypePredicate) { public DefaultHttpDataSource(String userAgent, @Nullable Predicate<String> contentTypePredicate) {
this( this(
......
...@@ -134,6 +134,7 @@ public final class SimpleCache implements Cache { ...@@ -134,6 +134,7 @@ public final class SimpleCache implements Cache {
* @deprecated Use a constructor that takes a {@link DatabaseProvider} for improved performance. * @deprecated Use a constructor that takes a {@link DatabaseProvider} for improved performance.
*/ */
@Deprecated @Deprecated
@SuppressWarnings("deprecation")
public SimpleCache(File cacheDir, CacheEvictor evictor) { public SimpleCache(File cacheDir, CacheEvictor evictor) {
this(cacheDir, evictor, null, false); this(cacheDir, evictor, null, false);
} }
......
...@@ -1603,6 +1603,7 @@ public final class AnalyticsCollectorTest { ...@@ -1603,6 +1603,7 @@ public final class AnalyticsCollectorTest {
assertThat(reportedEvents).isEmpty(); assertThat(reportedEvents).isEmpty();
} }
@SuppressWarnings("deprecation") // Testing deprecated behaviour.
@Override @Override
public void onPlayerStateChanged( public void onPlayerStateChanged(
EventTime eventTime, boolean playWhenReady, @Player.State int playbackState) { EventTime eventTime, boolean playWhenReady, @Player.State int playbackState) {
...@@ -1626,6 +1627,7 @@ public final class AnalyticsCollectorTest { ...@@ -1626,6 +1627,7 @@ public final class AnalyticsCollectorTest {
reportedEvents.add(new ReportedEvent(EVENT_SEEK_STARTED, eventTime)); reportedEvents.add(new ReportedEvent(EVENT_SEEK_STARTED, eventTime));
} }
@SuppressWarnings("deprecation") // Testing deprecated behaviour.
@Override @Override
public void onSeekProcessed(EventTime eventTime) { public void onSeekProcessed(EventTime eventTime) {
reportedEvents.add(new ReportedEvent(EVENT_SEEK_PROCESSED, eventTime)); reportedEvents.add(new ReportedEvent(EVENT_SEEK_PROCESSED, eventTime));
......
...@@ -82,6 +82,7 @@ public class SsMediaSourceTest { ...@@ -82,6 +82,7 @@ public class SsMediaSourceTest {
} }
// Tests backwards compatibility // Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test @Test
public void factoryCreateMediaSource_setsDeprecatedMediaSourceTag() { public void factoryCreateMediaSource_setsDeprecatedMediaSourceTag() {
Object tag = new Object(); Object tag = new Object();
......
...@@ -971,6 +971,8 @@ public class PlayerNotificationManager { ...@@ -971,6 +971,8 @@ public class PlayerNotificationManager {
} }
} }
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings("deprecation")
private void startOrUpdateNotification(Player player, @Nullable Bitmap bitmap) { private void startOrUpdateNotification(Player player, @Nullable Bitmap bitmap) {
boolean ongoing = getOngoing(player); boolean ongoing = getOngoing(player);
builder = createNotification(player, builder, ongoing, bitmap); builder = createNotification(player, builder, ongoing, bitmap);
...@@ -993,6 +995,8 @@ public class PlayerNotificationManager { ...@@ -993,6 +995,8 @@ public class PlayerNotificationManager {
} }
} }
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings("deprecation")
private void stopNotification(boolean dismissedByUser) { private void stopNotification(boolean dismissedByUser) {
if (isNotificationStarted) { if (isNotificationStarted) {
isNotificationStarted = false; isNotificationStarted = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment