Remove NullableType usage from release branch

This commit is contained in:
Oliver Woodman 2018-06-05 22:37:44 +01:00
parent 97e68ecc31
commit a877bbaf7b
5 changed files with 11 additions and 16 deletions

View File

@ -54,7 +54,6 @@ android {
dependencies { dependencies {
implementation 'com.android.support:support-annotations:' + supportLibraryVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkVersion
androidTestImplementation 'com.google.dexmaker:dexmaker:' + dexmakerVersion androidTestImplementation 'com.google.dexmaker:dexmaker:' + dexmakerVersion
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion
androidTestImplementation 'com.google.truth:truth:' + truthVersion androidTestImplementation 'com.google.truth:truth:' + truthVersion

View File

@ -43,7 +43,6 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/** /**
* A default {@link TrackSelector} suitable for most use cases. Track selections are made according * A default {@link TrackSelector} suitable for most use cases. Track selections are made according
@ -1214,7 +1213,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
// Initialize the renderer configurations to the default configuration for all renderers with // Initialize the renderer configurations to the default configuration for all renderers with
// selections, and null otherwise. // selections, and null otherwise.
@NullableType RendererConfiguration[] rendererConfigurations = RendererConfiguration[] rendererConfigurations =
new RendererConfiguration[rendererCount]; new RendererConfiguration[rendererCount];
for (int i = 0; i < rendererCount; i++) { for (int i = 0; i < rendererCount; i++) {
boolean forceRendererDisabled = params.getRendererDisabled(i); boolean forceRendererDisabled = params.getRendererDisabled(i);
@ -1254,14 +1253,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* disabled, unless RendererCapabilities#getTrackType()} is {@link C#TRACK_TYPE_NONE}. * disabled, unless RendererCapabilities#getTrackType()} is {@link C#TRACK_TYPE_NONE}.
* @throws ExoPlaybackException If an error occurs while selecting the tracks. * @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/ */
protected @NullableType TrackSelection[] selectAllTracks( protected TrackSelection[] selectAllTracks(
MappedTrackInfo mappedTrackInfo, MappedTrackInfo mappedTrackInfo,
int[][][] rendererFormatSupports, int[][][] rendererFormatSupports,
int[] rendererMixedMimeTypeAdaptationSupports, int[] rendererMixedMimeTypeAdaptationSupports,
Parameters params) Parameters params)
throws ExoPlaybackException { throws ExoPlaybackException {
int rendererCount = mappedTrackInfo.getRendererCount(); int rendererCount = mappedTrackInfo.getRendererCount();
@NullableType TrackSelection[] rendererTrackSelections = new TrackSelection[rendererCount]; TrackSelection[] rendererTrackSelections = new TrackSelection[rendererCount];
boolean seenVideoRendererWithMappedTracks = false; boolean seenVideoRendererWithMappedTracks = false;
boolean selectedVideoTracks = false; boolean selectedVideoTracks = false;
@ -1792,8 +1791,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private static void maybeConfigureRenderersForTunneling( private static void maybeConfigureRenderersForTunneling(
MappedTrackInfo mappedTrackInfo, MappedTrackInfo mappedTrackInfo,
int[][][] renderererFormatSupports, int[][][] renderererFormatSupports,
@NullableType RendererConfiguration[] rendererConfigurations, RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] trackSelections, TrackSelection[] trackSelections,
int tunnelingAudioSessionId) { int tunnelingAudioSessionId) {
if (tunnelingAudioSessionId == C.AUDIO_SESSION_ID_UNSET) { if (tunnelingAudioSessionId == C.AUDIO_SESSION_ID_UNSET) {
return; return;

View File

@ -29,7 +29,6 @@ import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.Arrays; import java.util.Arrays;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/** /**
* Base class for {@link TrackSelector}s that first establish a mapping between {@link TrackGroup}s * Base class for {@link TrackSelector}s that first establish a mapping between {@link TrackGroup}s

View File

@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import java.util.Arrays; import java.util.Arrays;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/** An array of {@link TrackSelection}s. */ /** An array of {@link TrackSelection}s. */
public final class TrackSelectionArray { public final class TrackSelectionArray {
@ -25,13 +24,13 @@ public final class TrackSelectionArray {
/** The length of this array. */ /** The length of this array. */
public final int length; public final int length;
private final @NullableType TrackSelection[] trackSelections; private final TrackSelection[] trackSelections;
// Lazily initialized hashcode. // Lazily initialized hashcode.
private int hashCode; private int hashCode;
/** @param trackSelections The selections. Must not be null, but may contain null elements. */ /** @param trackSelections The selections. Must not be null, but may contain null elements. */
public TrackSelectionArray(@NullableType TrackSelection... trackSelections) { public TrackSelectionArray(TrackSelection... trackSelections) {
this.trackSelections = trackSelections; this.trackSelections = trackSelections;
this.length = trackSelections.length; this.length = trackSelections.length;
} }
@ -47,7 +46,7 @@ public final class TrackSelectionArray {
} }
/** Returns the selections in a newly allocated array. */ /** Returns the selections in a newly allocated array. */
public @NullableType TrackSelection[] getAll() { public TrackSelection[] getAll() {
return trackSelections.clone(); return trackSelections.clone();
} }

View File

@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
import com.google.android.exoplayer2.RendererConfiguration; import com.google.android.exoplayer2.RendererConfiguration;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/** /**
* The result of a {@link TrackSelector} operation. * The result of a {@link TrackSelector} operation.
@ -30,7 +29,7 @@ public final class TrackSelectorResult {
* A {@link RendererConfiguration} for each renderer. A null entry indicates the corresponding * A {@link RendererConfiguration} for each renderer. A null entry indicates the corresponding
* renderer should be disabled. * renderer should be disabled.
*/ */
public final @NullableType RendererConfiguration[] rendererConfigurations; public final RendererConfiguration[] rendererConfigurations;
/** /**
* A {@link TrackSelectionArray} containing the track selection for each renderer. * A {@link TrackSelectionArray} containing the track selection for each renderer.
*/ */
@ -49,8 +48,8 @@ public final class TrackSelectorResult {
* TrackSelector#onSelectionActivated(Object)} should the selection be activated. * TrackSelector#onSelectionActivated(Object)} should the selection be activated.
*/ */
public TrackSelectorResult( public TrackSelectorResult(
@NullableType RendererConfiguration[] rendererConfigurations, RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] selections, TrackSelection[] selections,
Object info) { Object info) {
this.rendererConfigurations = rendererConfigurations; this.rendererConfigurations = rendererConfigurations;
this.selections = new TrackSelectionArray(selections); this.selections = new TrackSelectionArray(selections);