Commit 0abdfe94 by olly Committed by Ian Baker

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

PiperOrigin-RevId: 342952746
parent eb8a57ee
Showing with 124 additions and 13 deletions
...@@ -103,6 +103,8 @@ public final class AudioCapabilities { ...@@ -103,6 +103,8 @@ public final class AudioCapabilities {
* supported. * supported.
* @param maxChannelCount The maximum number of audio channels that can be played simultaneously. * @param maxChannelCount The maximum number of audio channels that can be played simultaneously.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public AudioCapabilities(@Nullable int[] supportedEncodings, int maxChannelCount) { public AudioCapabilities(@Nullable int[] supportedEncodings, int maxChannelCount) {
if (supportedEncodings != null) { if (supportedEncodings != null) {
this.supportedEncodings = Arrays.copyOf(supportedEncodings, supportedEncodings.length); this.supportedEncodings = Arrays.copyOf(supportedEncodings, supportedEncodings.length);
......
...@@ -288,6 +288,8 @@ public interface AudioSink { ...@@ -288,6 +288,8 @@ public interface AudioSink {
* is applied the audio data will have {@code outputChannels.length} channels. * is applied the audio data will have {@code outputChannels.length} channels.
* @throws ConfigurationException If an error occurs configuring the sink. * @throws ConfigurationException If an error occurs configuring the sink.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels) void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels)
throws ConfigurationException; throws ConfigurationException;
......
...@@ -26,8 +26,14 @@ import java.nio.ByteBuffer; ...@@ -26,8 +26,14 @@ import java.nio.ByteBuffer;
*/ */
/* package */ final class ChannelMappingAudioProcessor extends BaseAudioProcessor { /* package */ final class ChannelMappingAudioProcessor extends BaseAudioProcessor {
@Nullable private int[] pendingOutputChannels; // nullness annotations are not applicable to primitive types
@Nullable private int[] outputChannels; @SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private int[] pendingOutputChannels;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private int[] outputChannels;
/** /**
* Resets the channel mapping. After calling this method, call {@link #configure(AudioFormat)} to * Resets the channel mapping. After calling this method, call {@link #configure(AudioFormat)} to
...@@ -37,6 +43,8 @@ import java.nio.ByteBuffer; ...@@ -37,6 +43,8 @@ import java.nio.ByteBuffer;
* leave the input unchanged. * leave the input unchanged.
* @see AudioSink#configure(com.google.android.exoplayer2.Format, int, int[]) * @see AudioSink#configure(com.google.android.exoplayer2.Format, int, int[])
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public void setChannelMap(@Nullable int[] outputChannels) { public void setChannelMap(@Nullable int[] outputChannels) {
pendingOutputChannels = outputChannels; pendingOutputChannels = outputChannels;
} }
...@@ -44,7 +52,10 @@ import java.nio.ByteBuffer; ...@@ -44,7 +52,10 @@ import java.nio.ByteBuffer;
@Override @Override
public AudioFormat onConfigure(AudioFormat inputAudioFormat) public AudioFormat onConfigure(AudioFormat inputAudioFormat)
throws UnhandledAudioFormatException { throws UnhandledAudioFormatException {
@Nullable int[] outputChannels = pendingOutputChannels; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
int[] outputChannels = pendingOutputChannels;
if (outputChannels == null) { if (outputChannels == null) {
return AudioFormat.NOT_SET; return AudioFormat.NOT_SET;
} }
......
...@@ -50,6 +50,8 @@ public class ForwardingAudioSink implements AudioSink { ...@@ -50,6 +50,8 @@ public class ForwardingAudioSink implements AudioSink {
return sink.getCurrentPositionUs(sourceEnded); return sink.getCurrentPositionUs(sourceEnded);
} }
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Override @Override
public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels) public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels)
throws ConfigurationException { throws ConfigurationException {
......
...@@ -335,6 +335,8 @@ class AsynchronousMediaCodecBufferEnqueuer { ...@@ -335,6 +335,8 @@ class AsynchronousMediaCodecBufferEnqueuer {
* @param dst The destination array, which will be reused if it's at least as long as {@code src}. * @param dst The destination array, which will be reused if it's at least as long as {@code src}.
* @return The copy, which may be {@code dst} if it was reused. * @return The copy, which may be {@code dst} if it was reused.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
private static int[] copy(@Nullable int[] src, @Nullable int[] dst) { private static int[] copy(@Nullable int[] src, @Nullable int[] dst) {
if (src == null) { if (src == null) {
...@@ -356,6 +358,8 @@ class AsynchronousMediaCodecBufferEnqueuer { ...@@ -356,6 +358,8 @@ class AsynchronousMediaCodecBufferEnqueuer {
* @param dst The destination array, which will be reused if it's at least as long as {@code src}. * @param dst The destination array, which will be reused if it's at least as long as {@code src}.
* @return The copy, which may be {@code dst} if it was reused. * @return The copy, which may be {@code dst} if it was reused.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
private static byte[] copy(@Nullable byte[] src, @Nullable byte[] dst) { private static byte[] copy(@Nullable byte[] src, @Nullable byte[] dst) {
if (src == null) { if (src == null) {
......
...@@ -59,6 +59,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -59,6 +59,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable @Nullable
private MediaFormat pendingOutputFormat; private MediaFormat pendingOutputFormat;
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@GuardedBy("lock") @GuardedBy("lock")
@Nullable @Nullable
private MediaCodec.CodecException mediaCodecException; private MediaCodec.CodecException mediaCodecException;
...@@ -212,6 +214,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -212,6 +214,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public void onOutputBufferAvailable( public void onOutputBufferAvailable(
@NonNull MediaCodec codec, int index, @NonNull MediaCodec.BufferInfo info) { @NonNull MediaCodec codec, int index, @NonNull MediaCodec.BufferInfo info) {
...@@ -225,6 +229,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -225,6 +229,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public void onError(@NonNull MediaCodec codec, @NonNull MediaCodec.CodecException e) { public void onError(@NonNull MediaCodec codec, @NonNull MediaCodec.CodecException e) {
synchronized (lock) { synchronized (lock) {
......
...@@ -935,7 +935,10 @@ public final class MediaCodecUtil { ...@@ -935,7 +935,10 @@ public final class MediaCodecUtil {
private final int codecKind; private final int codecKind;
@Nullable private android.media.MediaCodecInfo[] mediaCodecInfos; // nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
private android.media.MediaCodecInfo[] mediaCodecInfos;
public MediaCodecListCompatV21(boolean includeSecure, boolean includeTunneling) { public MediaCodecListCompatV21(boolean includeSecure, boolean includeTunneling) {
codecKind = codecKind =
......
...@@ -85,6 +85,8 @@ public final class MediaFormatUtil { ...@@ -85,6 +85,8 @@ public final class MediaFormatUtil {
* @param key The key to set. * @param key The key to set.
* @param value The byte array that will be wrapped to obtain the value. * @param value The byte array that will be wrapped to obtain the value.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public static void maybeSetByteBuffer(MediaFormat format, String key, @Nullable byte[] value) { public static void maybeSetByteBuffer(MediaFormat format, String key, @Nullable byte[] value) {
if (value != null) { if (value != null) {
format.setByteBuffer(key, ByteBuffer.wrap(value)); format.setByteBuffer(key, ByteBuffer.wrap(value));
......
...@@ -104,7 +104,10 @@ import java.util.List; ...@@ -104,7 +104,10 @@ import java.util.List;
boolean isRemoveAction = input.readBoolean(); boolean isRemoveAction = input.readBoolean();
int dataLength = input.readInt(); int dataLength = input.readInt();
@Nullable byte[] data; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
byte[] data;
if (dataLength != 0) { if (dataLength != 0) {
data = new byte[dataLength]; data = new byte[dataLength];
input.readFully(data); input.readFully(data);
......
...@@ -345,6 +345,8 @@ public final class DownloadHelper { ...@@ -345,6 +345,8 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
Context context, Context context,
MediaItem mediaItem, MediaItem mediaItem,
...@@ -374,6 +376,8 @@ public final class DownloadHelper { ...@@ -374,6 +376,8 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
MediaItem mediaItem, MediaItem mediaItem,
DefaultTrackSelector.Parameters trackSelectorParameters, DefaultTrackSelector.Parameters trackSelectorParameters,
...@@ -405,6 +409,8 @@ public final class DownloadHelper { ...@@ -405,6 +409,8 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
MediaItem mediaItem, MediaItem mediaItem,
DefaultTrackSelector.Parameters trackSelectorParameters, DefaultTrackSelector.Parameters trackSelectorParameters,
...@@ -724,6 +730,8 @@ public final class DownloadHelper { ...@@ -724,6 +730,8 @@ public final class DownloadHelper {
* @param data Application provided data to store in {@link DownloadRequest#data}. * @param data Application provided data to store in {@link DownloadRequest#data}.
* @return The built {@link DownloadRequest}. * @return The built {@link DownloadRequest}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest getDownloadRequest(@Nullable byte[] data) { public DownloadRequest getDownloadRequest(@Nullable byte[] data) {
return getDownloadRequest(playbackProperties.uri.toString(), data); return getDownloadRequest(playbackProperties.uri.toString(), data);
} }
...@@ -736,6 +744,8 @@ public final class DownloadHelper { ...@@ -736,6 +744,8 @@ public final class DownloadHelper {
* @param data Application provided data to store in {@link DownloadRequest#data}. * @param data Application provided data to store in {@link DownloadRequest#data}.
* @return The built {@link DownloadRequest}. * @return The built {@link DownloadRequest}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest getDownloadRequest(String id, @Nullable byte[] data) { public DownloadRequest getDownloadRequest(String id, @Nullable byte[] data) {
DownloadRequest.Builder requestBuilder = DownloadRequest.Builder requestBuilder =
new DownloadRequest.Builder(id, playbackProperties.uri) new DownloadRequest.Builder(id, playbackProperties.uri)
......
...@@ -44,9 +44,16 @@ public final class DownloadRequest implements Parcelable { ...@@ -44,9 +44,16 @@ public final class DownloadRequest implements Parcelable {
private final Uri uri; private final Uri uri;
@Nullable private String mimeType; @Nullable private String mimeType;
@Nullable private List<StreamKey> streamKeys; @Nullable private List<StreamKey> streamKeys;
@Nullable private byte[] keySetId; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] keySetId;
@Nullable private String customCacheKey; @Nullable private String customCacheKey;
@Nullable private byte[] data; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] data;
/** Creates a new instance with the specified id and uri. */ /** Creates a new instance with the specified id and uri. */
public Builder(String id, Uri uri) { public Builder(String id, Uri uri) {
...@@ -67,6 +74,8 @@ public final class DownloadRequest implements Parcelable { ...@@ -67,6 +74,8 @@ public final class DownloadRequest implements Parcelable {
} }
/** Sets the {@link DownloadRequest#keySetId}. */ /** Sets the {@link DownloadRequest#keySetId}. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public Builder setKeySetId(@Nullable byte[] keySetId) { public Builder setKeySetId(@Nullable byte[] keySetId) {
this.keySetId = keySetId; this.keySetId = keySetId;
return this; return this;
...@@ -79,6 +88,8 @@ public final class DownloadRequest implements Parcelable { ...@@ -79,6 +88,8 @@ public final class DownloadRequest implements Parcelable {
} }
/** Sets the {@link DownloadRequest#data}. */ /** Sets the {@link DownloadRequest#data}. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public Builder setData(@Nullable byte[] data) { public Builder setData(@Nullable byte[] data) {
this.data = data; this.data = data;
return this; return this;
...@@ -109,7 +120,10 @@ public final class DownloadRequest implements Parcelable { ...@@ -109,7 +120,10 @@ public final class DownloadRequest implements Parcelable {
/** Stream keys to be downloaded. If empty, all streams will be downloaded. */ /** Stream keys to be downloaded. If empty, all streams will be downloaded. */
public final List<StreamKey> streamKeys; public final List<StreamKey> streamKeys;
/** The key set id of the offline licence if the content is protected with DRM. */ /** The key set id of the offline licence if the content is protected with DRM. */
@Nullable public final byte[] keySetId; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
public final byte[] keySetId;
/** /**
* Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming * Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming
* downloads. * downloads.
...@@ -126,6 +140,8 @@ public final class DownloadRequest implements Parcelable { ...@@ -126,6 +140,8 @@ public final class DownloadRequest implements Parcelable {
* @param customCacheKey See {@link #customCacheKey}. * @param customCacheKey See {@link #customCacheKey}.
* @param data See {@link #data}. * @param data See {@link #data}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
private DownloadRequest( private DownloadRequest(
String id, String id,
Uri uri, Uri uri,
...@@ -181,6 +197,8 @@ public final class DownloadRequest implements Parcelable { ...@@ -181,6 +197,8 @@ public final class DownloadRequest implements Parcelable {
* @param keySetId The key set ID of the copy. * @param keySetId The key set ID of the copy.
* @return The copy with the specified key set ID. * @return The copy with the specified key set ID.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest copyWithKeySetId(@Nullable byte[] keySetId) { public DownloadRequest copyWithKeySetId(@Nullable byte[] keySetId) {
return new DownloadRequest(id, uri, mimeType, streamKeys, keySetId, customCacheKey, data); return new DownloadRequest(id, uri, mimeType, streamKeys, keySetId, customCacheKey, data);
} }
......
...@@ -114,6 +114,8 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S ...@@ -114,6 +114,8 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
* @param mediaSourceEventDispatcher A dispatcher to notify of {@link MediaSourceEventListener} * @param mediaSourceEventDispatcher A dispatcher to notify of {@link MediaSourceEventListener}
* events. * events.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public ChunkSampleStream( public ChunkSampleStream(
int primaryTrackType, int primaryTrackType,
@Nullable int[] embeddedTrackTypes, @Nullable int[] embeddedTrackTypes,
......
...@@ -45,6 +45,8 @@ public abstract class DataChunk extends Chunk { ...@@ -45,6 +45,8 @@ public abstract class DataChunk extends Chunk {
* @param trackSelectionData See {@link #trackSelectionData}. * @param trackSelectionData See {@link #trackSelectionData}.
* @param data An optional recycled array that can be used as a holder for the data. * @param data An optional recycled array that can be used as a holder for the data.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DataChunk( public DataChunk(
DataSource dataSource, DataSource dataSource,
DataSpec dataSpec, DataSpec dataSpec,
......
...@@ -138,7 +138,10 @@ public final class MediaParserChunkExtractor implements ChunkExtractor { ...@@ -138,7 +138,10 @@ public final class MediaParserChunkExtractor implements ChunkExtractor {
// Internal methods. // Internal methods.
private void maybeExecutePendingSeek() { private void maybeExecutePendingSeek() {
@Nullable MediaParser.SeekMap dummySeekMap = outputConsumerAdapter.getDummySeekMap(); // nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
MediaParser.SeekMap dummySeekMap = outputConsumerAdapter.getDummySeekMap();
if (pendingSeekUs != C.TIME_UNSET && dummySeekMap != null) { if (pendingSeekUs != C.TIME_UNSET && dummySeekMap != null) {
mediaParser.seek(dummySeekMap.getSeekPoints(pendingSeekUs).first); mediaParser.seek(dummySeekMap.getSeekPoints(pendingSeekUs).first);
pendingSeekUs = C.TIME_UNSET; pendingSeekUs = C.TIME_UNSET;
......
...@@ -55,6 +55,8 @@ public final class ByteArrayDataSink implements DataSink { ...@@ -55,6 +55,8 @@ public final class ByteArrayDataSink implements DataSink {
* Returns the data written to the sink since the last call to {@link #open(DataSpec)}, or null if * Returns the data written to the sink since the last call to {@link #open(DataSpec)}, or null if
* {@link #open(DataSpec)} has never been called. * {@link #open(DataSpec)} has never been called.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] getData() { public byte[] getData() {
return stream == null ? null : stream.toByteArray(); return stream == null ? null : stream.toByteArray();
......
...@@ -34,7 +34,11 @@ public final class DataSchemeDataSource extends BaseDataSource { ...@@ -34,7 +34,11 @@ public final class DataSchemeDataSource extends BaseDataSource {
public static final String SCHEME_DATA = "data"; public static final String SCHEME_DATA = "data";
@Nullable private DataSpec dataSpec; @Nullable private DataSpec dataSpec;
@Nullable private byte[] data; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] data;
private int endPosition; private int endPosition;
private int readPosition; private int readPosition;
......
...@@ -32,7 +32,11 @@ public final class DefaultAllocator implements Allocator { ...@@ -32,7 +32,11 @@ public final class DefaultAllocator implements Allocator {
private final boolean trimOnReset; private final boolean trimOnReset;
private final int individualAllocationSize; private final int individualAllocationSize;
@Nullable private final byte[] initialAllocationBlock; // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private final byte[] initialAllocationBlock;
private final Allocation[] singleAllocationReleaseHolder; private final Allocation[] singleAllocationReleaseHolder;
private int targetBufferSize; private int targetBufferSize;
......
...@@ -334,7 +334,11 @@ public final class Loader implements LoaderErrorThrower { ...@@ -334,7 +334,11 @@ public final class Loader implements LoaderErrorThrower {
private final T loadable; private final T loadable;
private final long startTimeMs; private final long startTimeMs;
@Nullable private Loader.Callback<T> callback; // nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
private Loader.Callback<T> callback;
@Nullable private IOException currentError; @Nullable private IOException currentError;
private int errorCount; private int errorCount;
......
...@@ -45,6 +45,8 @@ import java.util.Map; ...@@ -45,6 +45,8 @@ import java.util.Map;
* Returns the {@code encryptionKey} cached against this {@code uri}, or null if {@code uri} is * Returns the {@code encryptionKey} cached against this {@code uri}, or null if {@code uri} is
* null or not present in the cache. * null or not present in the cache.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] get(@Nullable Uri uri) { public byte[] get(@Nullable Uri uri) {
if (uri == null) { if (uri == null) {
...@@ -58,6 +60,8 @@ import java.util.Map; ...@@ -58,6 +60,8 @@ import java.util.Map;
* *
* @throws NullPointerException if {@code uri} or {@code encryptionKey} are null. * @throws NullPointerException if {@code uri} or {@code encryptionKey} are null.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] put(Uri uri, byte[] encryptionKey) { public byte[] put(Uri uri, byte[] encryptionKey) {
return backingMap.put(Assertions.checkNotNull(uri), Assertions.checkNotNull(encryptionKey)); return backingMap.put(Assertions.checkNotNull(uri), Assertions.checkNotNull(encryptionKey));
...@@ -78,6 +82,8 @@ import java.util.Map; ...@@ -78,6 +82,8 @@ import java.util.Map;
* *
* @throws NullPointerException if {@code uri} is null. * @throws NullPointerException if {@code uri} is null.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] remove(Uri uri) { public byte[] remove(Uri uri) {
return backingMap.remove(Assertions.checkNotNull(uri)); return backingMap.remove(Assertions.checkNotNull(uri));
......
...@@ -669,7 +669,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -669,7 +669,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
return null; return null;
} }
@Nullable byte[] encryptionKey = keyCache.remove(keyUri); // nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
byte[] encryptionKey = keyCache.remove(keyUri);
if (encryptionKey != null) { if (encryptionKey != null) {
// The key was present in the key cache. We re-insert it to prevent it from being evicted by // The key was present in the key cache. We re-insert it to prevent it from being evicted by
// the following key addition. Note that removal of the key is necessary to affect the // the following key addition. Note that removal of the key is necessary to affect the
...@@ -688,6 +691,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -688,6 +691,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
scratchSpace); scratchSpace);
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable @Nullable
private static Uri getFullEncryptionKeyUri( private static Uri getFullEncryptionKeyUri(
HlsMediaPlaylist playlist, @Nullable HlsMediaPlaylist.SegmentBase segmentBase) { HlsMediaPlaylist playlist, @Nullable HlsMediaPlaylist.SegmentBase segmentBase) {
...@@ -791,6 +796,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -791,6 +796,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
/** Return the result of this chunk, or null if loading is not complete. */ /** Return the result of this chunk, or null if loading is not complete. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] getResult() { public byte[] getResult() {
return result; return result;
......
...@@ -73,6 +73,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -73,6 +73,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* @param initSegmentKey The initialization segment decryption key, if fully encrypted. Null * @param initSegmentKey The initialization segment decryption key, if fully encrypted. Null
* otherwise. * otherwise.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public static HlsMediaChunk createInstance( public static HlsMediaChunk createInstance(
HlsExtractorFactory extractorFactory, HlsExtractorFactory extractorFactory,
DataSource dataSource, DataSource dataSource,
...@@ -97,6 +99,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -97,6 +99,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
mediaSegment.byteRangeOffset, mediaSegment.byteRangeOffset,
mediaSegment.byteRangeLength); mediaSegment.byteRangeLength);
boolean mediaSegmentEncrypted = mediaSegmentKey != null; boolean mediaSegmentEncrypted = mediaSegmentKey != null;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
byte[] mediaSegmentIv = byte[] mediaSegmentIv =
mediaSegmentEncrypted mediaSegmentEncrypted
...@@ -111,6 +115,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -111,6 +115,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Nullable DataSource initDataSource = null; @Nullable DataSource initDataSource = null;
if (initSegment != null) { if (initSegment != null) {
initSegmentEncrypted = initSegmentKey != null; initSegmentEncrypted = initSegmentKey != null;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
byte[] initSegmentIv = byte[] initSegmentIv =
initSegmentEncrypted initSegmentEncrypted
...@@ -536,6 +542,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -536,6 +542,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* *
* <p>{@code fullSegmentEncryptionKey} & {@code encryptionIv} can either both be null, or neither. * <p>{@code fullSegmentEncryptionKey} & {@code encryptionIv} can either both be null, or neither.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
private static DataSource buildDataSource( private static DataSource buildDataSource(
DataSource dataSource, DataSource dataSource,
@Nullable byte[] fullSegmentEncryptionKey, @Nullable byte[] fullSegmentEncryptionKey,
......
...@@ -211,6 +211,8 @@ public final class HlsMediaSource extends BaseMediaSource ...@@ -211,6 +211,8 @@ public final class HlsMediaSource extends BaseMediaSource
* @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances. * @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances.
* @return This factory, for convenience. * @return This factory, for convenience.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public Factory setPlaylistTrackerFactory( public Factory setPlaylistTrackerFactory(
@Nullable HlsPlaylistTracker.Factory playlistTrackerFactory) { @Nullable HlsPlaylistTracker.Factory playlistTrackerFactory) {
this.playlistTrackerFactory = this.playlistTrackerFactory =
...@@ -295,6 +297,8 @@ public final class HlsMediaSource extends BaseMediaSource ...@@ -295,6 +297,8 @@ public final class HlsMediaSource extends BaseMediaSource
return this; return this;
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public Factory setDrmHttpDataSourceFactory( public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) { @Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
......
...@@ -255,6 +255,8 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt ...@@ -255,6 +255,8 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt
this.extractorInput = extractorInput; this.extractorInput = extractorInput;
} }
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Override @Override
public int read(@NonNull byte[] buffer, int offset, int readLength) throws IOException { public int read(@NonNull byte[] buffer, int offset, int readLength) throws IOException {
int peekedBytes = extractorInput.peek(buffer, offset, readLength); int peekedBytes = extractorInput.peek(buffer, offset, readLength);
......
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