Commit 9ccbb5bd by olly Committed by Oliver Woodman

Add some missing Nullable annotations

Also remove NonNull, since we assume NonNull by default. Except
where explicitly overriding a method with NonNull annotated args,
in which case we're still expected to use it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209758204
parent e2ebb78b
...@@ -490,7 +490,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -490,7 +490,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
return codec; return codec;
} }
protected final MediaCodecInfo getCodecInfo() { protected final @Nullable MediaCodecInfo getCodecInfo() {
return codecInfo; return codecInfo;
} }
......
...@@ -19,6 +19,7 @@ import android.content.Context; ...@@ -19,6 +19,7 @@ import android.content.Context;
import android.graphics.Point; import android.graphics.Point;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Pair; import android.util.Pair;
...@@ -2032,7 +2033,7 @@ public class DefaultTrackSelector extends MappingTrackSelector { ...@@ -2032,7 +2033,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* negative integer if this score is worse than the other. * negative integer if this score is worse than the other.
*/ */
@Override @Override
public int compareTo(AudioTrackScore other) { public int compareTo(@NonNull AudioTrackScore other) {
if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) { if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) {
return compareInts(this.withinRendererCapabilitiesScore, return compareInts(this.withinRendererCapabilitiesScore,
other.withinRendererCapabilitiesScore); other.withinRendererCapabilitiesScore);
......
...@@ -379,7 +379,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou ...@@ -379,7 +379,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
* *
* @return The current open connection, or null. * @return The current open connection, or null.
*/ */
protected final HttpURLConnection getConnection() { protected final @Nullable HttpURLConnection getConnection() {
return connection; return connection;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package com.google.android.exoplayer2.upstream.cache; package com.google.android.exoplayer2.upstream.cache;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -96,7 +95,6 @@ public interface Cache { ...@@ -96,7 +95,6 @@ public interface Cache {
* @param listener The listener to add. * @param listener The listener to add.
* @return The current spans for the key. * @return The current spans for the key.
*/ */
@NonNull
NavigableSet<CacheSpan> addListener(String key, Listener listener); NavigableSet<CacheSpan> addListener(String key, Listener listener);
/** /**
...@@ -113,7 +111,6 @@ public interface Cache { ...@@ -113,7 +111,6 @@ public interface Cache {
* @param key The key for which spans should be returned. * @param key The key for which spans should be returned.
* @return The spans for the key. * @return The spans for the key.
*/ */
@NonNull
NavigableSet<CacheSpan> getCachedSpans(String key); NavigableSet<CacheSpan> getCachedSpans(String key);
/** /**
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.upstream.cache; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.upstream.cache;
import android.os.ConditionVariable; import android.os.ConditionVariable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log; import android.util.Log;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
...@@ -224,7 +225,7 @@ public final class SimpleCache implements Cache { ...@@ -224,7 +225,7 @@ public final class SimpleCache implements Cache {
} }
@Override @Override
public synchronized SimpleCacheSpan startReadWriteNonBlocking(String key, long position) public synchronized @Nullable SimpleCacheSpan startReadWriteNonBlocking(String key, long position)
throws CacheException { throws CacheException {
Assertions.checkState(!released); Assertions.checkState(!released);
SimpleCacheSpan cacheSpan = getSpan(key, position); SimpleCacheSpan cacheSpan = getSpan(key, position);
......
...@@ -155,7 +155,7 @@ public final class DefaultHlsPlaylistTracker ...@@ -155,7 +155,7 @@ public final class DefaultHlsPlaylistTracker
} }
@Override @Override
public HlsMasterPlaylist getMasterPlaylist() { public @Nullable HlsMasterPlaylist getMasterPlaylist() {
return masterPlaylist; return masterPlaylist;
} }
......
...@@ -597,7 +597,7 @@ public class PlayerView extends FrameLayout { ...@@ -597,7 +597,7 @@ public class PlayerView extends FrameLayout {
} }
/** Returns the default artwork to display. */ /** Returns the default artwork to display. */
public Drawable getDefaultArtwork() { public @Nullable Drawable getDefaultArtwork() {
return defaultArtwork; return defaultArtwork;
} }
......
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