mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add missing Nullable annotation Player.EventListener.onTimelineChanged
Issue: #4593 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=206911927
This commit is contained in:
parent
5715960304
commit
45c1e9eef3
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.castdemo;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import com.google.android.exoplayer2.C;
|
||||
@ -276,7 +277,7 @@ import java.util.ArrayList;
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @TimelineChangeReason int reason) {
|
||||
Timeline timeline, @Nullable Object manifest, @TimelineChangeReason int reason) {
|
||||
updateCurrentItemIndex();
|
||||
if (timeline.isEmpty()) {
|
||||
castMediaQueueCreationPending = true;
|
||||
|
@ -837,8 +837,8 @@ public final class ImaAdsLoader
|
||||
// Player.EventListener implementation.
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest,
|
||||
@Player.TimelineChangeReason int reason) {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
if (reason == Player.TIMELINE_CHANGE_REASON_RESET) {
|
||||
// The player is being reset and this source will be released.
|
||||
return;
|
||||
|
@ -288,8 +288,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest,
|
||||
@TimelineChangeReason int reason) {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Nullable Object manifest, @TimelineChangeReason int reason) {
|
||||
Callback callback = getCallback();
|
||||
callback.onDurationChanged(LeanbackPlayerAdapter.this);
|
||||
callback.onCurrentPositionChanged(LeanbackPlayerAdapter.this);
|
||||
|
@ -774,7 +774,7 @@ public final class MediaSessionConnector {
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
int windowCount = player.getCurrentTimeline().getWindowCount();
|
||||
int windowIndex = player.getCurrentWindowIndex();
|
||||
if (queueNavigator != null) {
|
||||
|
@ -248,7 +248,7 @@ public interface Player {
|
||||
* @param reason The {@link TimelineChangeReason} responsible for this timeline change.
|
||||
*/
|
||||
default void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @TimelineChangeReason int reason) {}
|
||||
Timeline timeline, @Nullable Object manifest, @TimelineChangeReason int reason) {}
|
||||
|
||||
/**
|
||||
* Called when the available or selected tracks change.
|
||||
@ -340,15 +340,15 @@ public interface Player {
|
||||
abstract class DefaultEventListener implements EventListener {
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest,
|
||||
@TimelineChangeReason int reason) {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Nullable Object manifest, @TimelineChangeReason int reason) {
|
||||
// Call deprecated version. Otherwise, do nothing.
|
||||
onTimelineChanged(timeline, manifest);
|
||||
}
|
||||
|
||||
/** @deprecated Use {@link EventListener#onTimelineChanged(Timeline, Object, int)} instead. */
|
||||
@Deprecated
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest) {
|
||||
public void onTimelineChanged(Timeline timeline, @Nullable Object manifest) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ public class AnalyticsCollector
|
||||
|
||||
@Override
|
||||
public final void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
mediaPeriodQueueTracker.onTimelineChanged(timeline);
|
||||
EventTime eventTime = generatePlayingMediaPeriodEventTime();
|
||||
for (AnalyticsListener listener : listeners) {
|
||||
|
@ -2186,7 +2186,7 @@ public final class ExoPlayerTest {
|
||||
final EventListener eventListener =
|
||||
new EventListener() {
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest, int reason) {
|
||||
public void onTimelineChanged(Timeline timeline, @Nullable Object manifest, int reason) {
|
||||
if (timeline.isEmpty()) {
|
||||
playerReference.get().setPlayWhenReady(/* playWhenReady= */ false);
|
||||
}
|
||||
|
@ -1090,7 +1090,7 @@ public class PlayerControlView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
updateNavigation();
|
||||
updateTimeBarMode();
|
||||
updateProgress();
|
||||
|
@ -953,7 +953,7 @@ public class PlayerNotificationManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest, int reason) {
|
||||
public void onTimelineChanged(Timeline timeline, @Nullable Object manifest, int reason) {
|
||||
if (player == null || player.getPlaybackState() == Player.STATE_IDLE) {
|
||||
return;
|
||||
}
|
||||
|
@ -575,7 +575,9 @@ public abstract class Action {
|
||||
new Player.EventListener() {
|
||||
@Override
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
Timeline timeline,
|
||||
@Nullable Object manifest,
|
||||
@Player.TimelineChangeReason int reason) {
|
||||
if (expectedTimeline == null || timeline.equals(expectedTimeline)) {
|
||||
player.removeListener(this);
|
||||
nextAction.schedule(player, trackSelector, surface, handler);
|
||||
|
@ -608,8 +608,8 @@ public final class ExoPlayerTestRunner implements Player.EventListener, ActionSc
|
||||
// Player.EventListener
|
||||
|
||||
@Override
|
||||
public void onTimelineChanged(Timeline timeline, Object manifest,
|
||||
@Player.TimelineChangeReason int reason) {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) {
|
||||
timelines.add(timeline);
|
||||
manifests.add(manifest);
|
||||
timelineChangeReasons.add(reason);
|
||||
|
Loading…
x
Reference in New Issue
Block a user