Remove nullness suppressions.

These were added in an internal clean-up and are better fixed than suppressed.

PiperOrigin-RevId: 236118715
This commit is contained in:
tonihei 2019-02-28 15:33:17 +00:00 committed by Oliver Woodman
parent 84e20216d7
commit 3eeb3acb3b
7 changed files with 12 additions and 22 deletions

View File

@ -137,11 +137,9 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
} }
/* package */ /* package */
// TODO(b/124903498): incompatible types in assignment.
@SuppressWarnings("nullness:assignment.type.incompatible")
DrmInitData(Parcel in) { DrmInitData(Parcel in) {
schemeType = in.readString(); schemeType = in.readString();
schemeDatas = in.createTypedArray(SchemeData.CREATOR); schemeDatas = Util.castNonNull(in.createTypedArray(SchemeData.CREATOR));
schemeDataCount = schemeDatas.length; schemeDataCount = schemeDatas.length;
} }

View File

@ -46,14 +46,12 @@ public final class ChapterTocFrame extends Id3Frame {
} }
/* package */ /* package */
// TODO(b/124903498): incompatible types in assignment.
@SuppressWarnings("nullness:assignment.type.incompatible")
ChapterTocFrame(Parcel in) { ChapterTocFrame(Parcel in) {
super(ID); super(ID);
this.elementId = castNonNull(in.readString()); this.elementId = castNonNull(in.readString());
this.isRoot = in.readByte() != 0; this.isRoot = in.readByte() != 0;
this.isOrdered = in.readByte() != 0; this.isOrdered = in.readByte() != 0;
this.children = in.createStringArray(); this.children = castNonNull(in.createStringArray());
int subFrameCount = in.readInt(); int subFrameCount = in.readInt();
subFrames = new Id3Frame[subFrameCount]; subFrames = new Id3Frame[subFrameCount];
for (int i = 0; i < subFrameCount; i++) { for (int i = 0; i < subFrameCount; i++) {

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import android.os.Parcel; import android.os.Parcel;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.util.Util;
import java.util.Arrays; import java.util.Arrays;
/** MPEG location lookup table frame. */ /** MPEG location lookup table frame. */
@ -45,15 +46,13 @@ public final class MlltFrame extends Id3Frame {
} }
/* package */ /* package */
// TODO(b/124903498): incompatible types in assignment.
@SuppressWarnings("nullness:assignment.type.incompatible")
MlltFrame(Parcel in) { MlltFrame(Parcel in) {
super(ID); super(ID);
this.mpegFramesBetweenReference = in.readInt(); this.mpegFramesBetweenReference = in.readInt();
this.bytesBetweenReference = in.readInt(); this.bytesBetweenReference = in.readInt();
this.millisecondsBetweenReference = in.readInt(); this.millisecondsBetweenReference = in.readInt();
this.bytesDeviations = in.createIntArray(); this.bytesDeviations = Util.castNonNull(in.createIntArray());
this.millisecondsDeviations = in.createIntArray(); this.millisecondsDeviations = Util.castNonNull(in.createIntArray());
} }
@Override @Override

View File

@ -363,13 +363,11 @@ public final class DownloadHelper {
* Looper}, in which case it will be called on the application's main thread. * Looper}, in which case it will be called on the application's main thread.
* @throws IllegalStateException If the download helper has already been prepared. * @throws IllegalStateException If the download helper has already been prepared.
*/ */
// TODO(b/124903498): incompatible types in argument.
@SuppressWarnings("nullness:argument.type.incompatible")
public void prepare(Callback callback) { public void prepare(Callback callback) {
Assertions.checkState(this.callback == null); Assertions.checkState(this.callback == null);
this.callback = callback; this.callback = callback;
callbackHandler = Looper myLooper = Looper.myLooper();
new Handler(Looper.myLooper() != null ? Looper.myLooper() : Looper.getMainLooper()); callbackHandler = new Handler(myLooper != null ? myLooper : Looper.getMainLooper());
if (mediaSource != null) { if (mediaSource != null) {
mediaPreparer = new MediaPreparer(mediaSource, /* downloadHelper= */ this); mediaPreparer = new MediaPreparer(mediaSource, /* downloadHelper= */ this);
} else { } else {

View File

@ -889,8 +889,6 @@ public class DefaultTrackSelector extends MappingTrackSelector {
} }
/* package */ /* package */
// TODO(b/124903498): incompatible types in assignment.
@SuppressWarnings("nullness:assignment.type.incompatible")
Parameters(Parcel in) { Parameters(Parcel in) {
super(in); super(in);
// Video // Video
@ -917,7 +915,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
this.tunnelingAudioSessionId = in.readInt(); this.tunnelingAudioSessionId = in.readInt();
// Overrides // Overrides
this.selectionOverrides = readSelectionOverrides(in); this.selectionOverrides = readSelectionOverrides(in);
this.rendererDisabledFlags = in.readSparseBooleanArray(); this.rendererDisabledFlags = Util.castNonNull(in.readSparseBooleanArray());
// Deprecated fields. // Deprecated fields.
this.allowMixedMimeAdaptiveness = allowVideoMixedMimeTypeAdaptiveness; this.allowMixedMimeAdaptiveness = allowVideoMixedMimeTypeAdaptiveness;
this.allowNonSeamlessAdaptiveness = allowVideoNonSeamlessAdaptiveness; this.allowNonSeamlessAdaptiveness = allowVideoNonSeamlessAdaptiveness;

View File

@ -162,8 +162,7 @@ public final class Util {
* @param intent The intent to pass to the called method. * @param intent The intent to pass to the called method.
* @return The result of the called method. * @return The result of the called method.
*/ */
// TODO(b/124903498): incompatible types in return. @Nullable
@SuppressWarnings("nullness:return.type.incompatible")
public static ComponentName startForegroundService(Context context, Intent intent) { public static ComponentName startForegroundService(Context context, Intent intent) {
if (Util.SDK_INT >= 26) { if (Util.SDK_INT >= 26) {
return context.startForegroundService(intent); return context.startForegroundService(intent);

View File

@ -1265,8 +1265,6 @@ public class PlayerNotificationManager {
private class NotificationBroadcastReceiver extends BroadcastReceiver { private class NotificationBroadcastReceiver extends BroadcastReceiver {
// TODO(b/124903498): incompatible types in argument.
@SuppressWarnings("nullness:argument.type.incompatible")
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Player player = PlayerNotificationManager.this.player; Player player = PlayerNotificationManager.this.player;
@ -1299,7 +1297,9 @@ public class PlayerNotificationManager {
controlDispatcher.dispatchStop(player, /* reset= */ true); controlDispatcher.dispatchStop(player, /* reset= */ true);
} else if (ACTION_DISMISS.equals(action)) { } else if (ACTION_DISMISS.equals(action)) {
stopNotification(/* dismissedByUser= */ true); stopNotification(/* dismissedByUser= */ true);
} else if (customActionReceiver != null && customActions.containsKey(action)) { } else if (action != null
&& customActionReceiver != null
&& customActions.containsKey(action)) {
customActionReceiver.onCustomAction(player, action, intent); customActionReceiver.onCustomAction(player, action, intent);
} }
} }