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 {
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkVersion
androidTestImplementation 'com.google.dexmaker:dexmaker:' + dexmakerVersion
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion
androidTestImplementation 'com.google.truth:truth:' + truthVersion

View File

@ -43,7 +43,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
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
@ -1214,7 +1213,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
// Initialize the renderer configurations to the default configuration for all renderers with
// selections, and null otherwise.
@NullableType RendererConfiguration[] rendererConfigurations =
RendererConfiguration[] rendererConfigurations =
new RendererConfiguration[rendererCount];
for (int i = 0; i < rendererCount; 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}.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/
protected @NullableType TrackSelection[] selectAllTracks(
protected TrackSelection[] selectAllTracks(
MappedTrackInfo mappedTrackInfo,
int[][][] rendererFormatSupports,
int[] rendererMixedMimeTypeAdaptationSupports,
Parameters params)
throws ExoPlaybackException {
int rendererCount = mappedTrackInfo.getRendererCount();
@NullableType TrackSelection[] rendererTrackSelections = new TrackSelection[rendererCount];
TrackSelection[] rendererTrackSelections = new TrackSelection[rendererCount];
boolean seenVideoRendererWithMappedTracks = false;
boolean selectedVideoTracks = false;
@ -1792,8 +1791,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private static void maybeConfigureRenderersForTunneling(
MappedTrackInfo mappedTrackInfo,
int[][][] renderererFormatSupports,
@NullableType RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] trackSelections,
RendererConfiguration[] rendererConfigurations,
TrackSelection[] trackSelections,
int tunnelingAudioSessionId) {
if (tunnelingAudioSessionId == C.AUDIO_SESSION_ID_UNSET) {
return;

View File

@ -29,7 +29,6 @@ import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
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

View File

@ -17,7 +17,6 @@ package com.google.android.exoplayer2.trackselection;
import android.support.annotation.Nullable;
import java.util.Arrays;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/** An array of {@link TrackSelection}s. */
public final class TrackSelectionArray {
@ -25,13 +24,13 @@ public final class TrackSelectionArray {
/** The length of this array. */
public final int length;
private final @NullableType TrackSelection[] trackSelections;
private final TrackSelection[] trackSelections;
// Lazily initialized hashcode.
private int hashCode;
/** @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.length = trackSelections.length;
}
@ -47,7 +46,7 @@ public final class TrackSelectionArray {
}
/** Returns the selections in a newly allocated array. */
public @NullableType TrackSelection[] getAll() {
public TrackSelection[] getAll() {
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.util.Util;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/**
* 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
* renderer should be disabled.
*/
public final @NullableType RendererConfiguration[] rendererConfigurations;
public final RendererConfiguration[] rendererConfigurations;
/**
* 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.
*/
public TrackSelectorResult(
@NullableType RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] selections,
RendererConfiguration[] rendererConfigurations,
TrackSelection[] selections,
Object info) {
this.rendererConfigurations = rendererConfigurations;
this.selections = new TrackSelectionArray(selections);