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:
eguven 2018-08-01 04:32:11 -07:00 committed by Oliver Woodman
parent 5715960304
commit 45c1e9eef3
11 changed files with 20 additions and 17 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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.
}
}

View File

@ -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) {

View File

@ -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);
}

View File

@ -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();

View File

@ -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;
}

View File

@ -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);

View File

@ -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);