mirror of
https://github.com/samsonjs/media.git
synced 2026-04-19 13:35:47 +00:00
Suppress deprecation warnings in deprecated places
PiperOrigin-RevId: 320970814
This commit is contained in:
parent
f205539616
commit
23d680a4b4
13 changed files with 21 additions and 1 deletions
|
|
@ -243,6 +243,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor)} and {@link
|
||||
* #setContentTypePredicate(Predicate)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
public CronetDataSource(
|
||||
CronetEngine cronetEngine,
|
||||
|
|
@ -276,6 +277,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor, int, int, boolean,
|
||||
* RequestProperties)} and {@link #setContentTypePredicate(Predicate)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
public CronetDataSource(
|
||||
CronetEngine cronetEngine,
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ import java.util.List;
|
|||
listener.onShuffleModeChanged(Utils.getShuffleMode(shuffleModeEnabled));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void handlePlaybackParametersChanged(PlaybackParameters playbackParameters) {
|
||||
listener.onPlaybackSpeedChanged(playbackParameters.speed);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||
* @deprecated Use {@link #OkHttpDataSource(Call.Factory, String)} and {@link
|
||||
* #setContentTypePredicate(Predicate)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
public OkHttpDataSource(
|
||||
Call.Factory callFactory,
|
||||
|
|
|
|||
|
|
@ -564,6 +564,7 @@ public final class C {
|
|||
// )
|
||||
|
||||
/** @deprecated Use {@code Renderer.VideoScalingMode}. */
|
||||
@SuppressWarnings("deprecation")
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@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 {
|
|||
return new Builder().setId(id).setSampleMimeType(sampleMimeType).build();
|
||||
}
|
||||
|
||||
// Some fields are deprecated but they're still assigned below.
|
||||
@SuppressWarnings("deprecation")
|
||||
/* package */ Format(
|
||||
@Nullable String id,
|
||||
@Nullable String label,
|
||||
|
|
@ -1298,7 +1300,8 @@ public final class Format implements Parcelable {
|
|||
this.exoMediaCryptoType = exoMediaCryptoType;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResourceType")
|
||||
// Some fields are deprecated but they're still assigned below.
|
||||
@SuppressWarnings({"ResourceType", "deprecation"})
|
||||
/* package */ Format(Parcel in) {
|
||||
id = in.readString();
|
||||
label = in.readString();
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ public interface AudioSink {
|
|||
* @deprecated Use {@link #setPlaybackSpeed(float)} and {@link #setSkipSilenceEnabled(boolean)}
|
||||
* instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
void setPlaybackParameters(PlaybackParameters playbackParameters);
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||
* @deprecated Use {@link #applyPlaybackSpeed(float)} and {@link
|
||||
* #applySkipSilenceEnabled(boolean)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
PlaybackParameters applyPlaybackParameters(PlaybackParameters playbackParameters);
|
||||
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
|
|||
}
|
||||
|
||||
/** @deprecated Use {@link Factory} instead. */
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
public SingleSampleMediaSource(
|
||||
Uri uri,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
* @deprecated Use {@link #DefaultHttpDataSource(String)} and {@link
|
||||
* #setContentTypePredicate(Predicate)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
public DefaultHttpDataSource(String userAgent, @Nullable Predicate<String> contentTypePredicate) {
|
||||
this(
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public final class SimpleCache implements Cache {
|
|||
* @deprecated Use a constructor that takes a {@link DatabaseProvider} for improved performance.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public SimpleCache(File cacheDir, CacheEvictor evictor) {
|
||||
this(cacheDir, evictor, null, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1603,6 +1603,7 @@ public final class AnalyticsCollectorTest {
|
|||
assertThat(reportedEvents).isEmpty();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Testing deprecated behaviour.
|
||||
@Override
|
||||
public void onPlayerStateChanged(
|
||||
EventTime eventTime, boolean playWhenReady, @Player.State int playbackState) {
|
||||
|
|
@ -1626,6 +1627,7 @@ public final class AnalyticsCollectorTest {
|
|||
reportedEvents.add(new ReportedEvent(EVENT_SEEK_STARTED, eventTime));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Testing deprecated behaviour.
|
||||
@Override
|
||||
public void onSeekProcessed(EventTime eventTime) {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_SEEK_PROCESSED, eventTime));
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class SsMediaSourceTest {
|
|||
}
|
||||
|
||||
// Tests backwards compatibility
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void factoryCreateMediaSource_setsDeprecatedMediaSourceTag() {
|
||||
Object tag = new Object();
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
boolean ongoing = getOngoing(player);
|
||||
builder = createNotification(player, builder, ongoing, bitmap);
|
||||
|
|
@ -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) {
|
||||
if (isNotificationStarted) {
|
||||
isNotificationStarted = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue