Remove deprecated Timeline.Window.isLive field

PiperOrigin-RevId: 636870982
This commit is contained in:
ibaker 2024-05-24 04:34:31 -07:00 committed by Copybara-Service
parent 08d1eb4376
commit 4a16212fb3
3 changed files with 2 additions and 11 deletions

View File

@ -205,6 +205,8 @@
Use `OkHttpDataSource.Factory` instead. Use `OkHttpDataSource.Factory` instead.
* Remove `PlayerMessage.setHandler(Handler)`. Use `setLooper(Looper)` * Remove `PlayerMessage.setHandler(Handler)`. Use `setLooper(Looper)`
instead. instead.
* Remove `Timeline.Window.isLive` field. Use the `isLive()` method
instead.
## 1.4 ## 1.4

View File

@ -17,7 +17,6 @@ package androidx.media3.common;
import static androidx.media3.common.AdPlaybackState.AD_STATE_UNAVAILABLE; import static androidx.media3.common.AdPlaybackState.AD_STATE_UNAVAILABLE;
import static androidx.media3.common.util.Assertions.checkArgument; import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkState;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.Math.min; import static java.lang.Math.min;
@ -219,11 +218,6 @@ public abstract class Timeline implements Bundleable {
/** Whether this window may change when the timeline is updated. */ /** Whether this window may change when the timeline is updated. */
public boolean isDynamic; public boolean isDynamic;
/**
* @deprecated Use {@link #isLive()} instead.
*/
@UnstableApi @Deprecated public boolean isLive;
/** /**
* The {@link MediaItem.LiveConfiguration} that is used or null if {@link #isLive()} returns * The {@link MediaItem.LiveConfiguration} that is used or null if {@link #isLive()} returns
* false. * false.
@ -296,7 +290,6 @@ public abstract class Timeline implements Bundleable {
this.elapsedRealtimeEpochOffsetMs = elapsedRealtimeEpochOffsetMs; this.elapsedRealtimeEpochOffsetMs = elapsedRealtimeEpochOffsetMs;
this.isSeekable = isSeekable; this.isSeekable = isSeekable;
this.isDynamic = isDynamic; this.isDynamic = isDynamic;
this.isLive = liveConfiguration != null;
this.liveConfiguration = liveConfiguration; this.liveConfiguration = liveConfiguration;
this.defaultPositionUs = defaultPositionUs; this.defaultPositionUs = defaultPositionUs;
this.durationUs = durationUs; this.durationUs = durationUs;
@ -364,10 +357,7 @@ public abstract class Timeline implements Bundleable {
} }
/** Returns whether this is a live stream. */ /** Returns whether this is a live stream. */
// Verifies whether the deprecated isLive member field is in a correct state.
@SuppressWarnings("deprecation")
public boolean isLive() { public boolean isLive() {
checkState(isLive == (liveConfiguration != null));
return liveConfiguration != null; return liveConfiguration != null;
} }

View File

@ -474,7 +474,6 @@ public class TimelineTest {
window.windowStartTimeMs = C.TIME_UNSET; window.windowStartTimeMs = C.TIME_UNSET;
window.isSeekable = true; window.isSeekable = true;
window.isDynamic = true; window.isDynamic = true;
window.isLive = true;
window.defaultPositionUs = C.TIME_UNSET; window.defaultPositionUs = C.TIME_UNSET;
window.durationUs = C.TIME_UNSET; window.durationUs = C.TIME_UNSET;
window.firstPeriodIndex = 1; window.firstPeriodIndex = 1;