mirror of
https://github.com/samsonjs/media.git
synced 2026-04-14 12:45:47 +00:00
Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc
Tested:
Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 379622938
This commit is contained in:
parent
2536222fbd
commit
a3dbd61239
24 changed files with 31 additions and 63 deletions
|
|
@ -169,7 +169,7 @@ public final class CronetEngineWrapper {
|
|||
|
||||
// Multi-catch can only be used for API 19+ in this case.
|
||||
// Field#get(null) is blocked by the null-checker, but is safe because the field is static.
|
||||
@SuppressWarnings({"UseMultiCatch", "nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings({"UseMultiCatch", "nullness:argument"})
|
||||
public CronetProviderComparator(boolean preferGMSCoreCronet) {
|
||||
// GMSCore CronetProvider classes are only available in some configurations.
|
||||
// Thus, we use reflection to copy static name.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
|
|||
*/
|
||||
}
|
||||
|
||||
@SuppressWarnings({"return.type.incompatible", "nullness:return"})
|
||||
@SuppressWarnings("nullness:return")
|
||||
@Override
|
||||
protected Decoder<VideoDecoderInputBuffer, VideoDecoderOutputBuffer, FfmpegDecoderException>
|
||||
createDecoder(Format format, @Nullable ExoMediaCrypto mediaCrypto)
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public final class FlacExtractor implements Extractor {
|
|||
}
|
||||
|
||||
@EnsuresNonNull({"decoderJni", "extractorOutput", "trackOutput"}) // Ensures initialized.
|
||||
@SuppressWarnings({"contracts.postcondition.not.satisfied", "nullness:contracts.postcondition"})
|
||||
@SuppressWarnings("nullness:contracts.postcondition")
|
||||
private FlacDecoderJni initDecoderJni(ExtractorInput input) {
|
||||
FlacDecoderJni decoderJni = Assertions.checkNotNull(this.decoderJni);
|
||||
decoderJni.setData(input);
|
||||
|
|
@ -186,7 +186,7 @@ public final class FlacExtractor implements Extractor {
|
|||
|
||||
@RequiresNonNull({"decoderJni", "extractorOutput", "trackOutput"}) // Requires initialized.
|
||||
@EnsuresNonNull({"streamMetadata", "outputFrameHolder"}) // Ensures stream metadata decoded.
|
||||
@SuppressWarnings({"contracts.postcondition.not.satisfied", "nullness:contracts.postcondition"})
|
||||
@SuppressWarnings("nullness:contracts.postcondition")
|
||||
private void decodeStreamMetadata(ExtractorInput input) throws IOException {
|
||||
if (streamMetadataDecoded) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -211,12 +211,7 @@ import java.util.Map;
|
|||
private long waitingForPreloadElapsedRealtimeMs;
|
||||
|
||||
/** Creates a new ad tag loader, starting the ad request if the ad tag is valid. */
|
||||
@SuppressWarnings({
|
||||
"methodref.receiver.bound.invalid",
|
||||
"nullness:methodref.receiver.bound",
|
||||
"method.invocation.invalid",
|
||||
"nullness:method.invocation"
|
||||
})
|
||||
@SuppressWarnings({"nullness:methodref.receiver.bound", "nullness:method.invocation"})
|
||||
public AdTagLoader(
|
||||
Context context,
|
||||
ImaUtil.Configuration configuration,
|
||||
|
|
|
|||
|
|
@ -734,7 +734,7 @@ public final class ImaAdsLoader implements Player.Listener, AdsLoader {
|
|||
|
||||
// The reasonDetail parameter to createFriendlyObstruction is annotated @Nullable but the
|
||||
// annotation is not kept in the obfuscated dependency.
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
@Override
|
||||
public FriendlyObstruction createFriendlyObstruction(
|
||||
View view,
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
private static void removeSurfaceHolderCallback(SurfaceHolderGlueHost surfaceHolderGlueHost) {
|
||||
surfaceHolderGlueHost.setSurfaceHolderCallback(null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ import java.util.concurrent.TimeoutException;
|
|||
// TODO(internal b/160846312): Remove warning suppression and mark item @Nullable once we depend
|
||||
// on media2 1.2.0.
|
||||
@Override
|
||||
@SuppressWarnings({"nullness:override.param.invalid", "nullness:override.param"})
|
||||
@SuppressWarnings("nullness:override.param")
|
||||
public void onCurrentMediaItemChanged(SessionPlayer player, MediaItem item) {
|
||||
currentMediaItemBuffered = isBufferedState(player.getBufferingState());
|
||||
updateAllowedCommands();
|
||||
|
|
|
|||
|
|
@ -571,7 +571,6 @@ public final class SessionPlayerConnector extends SessionPlayer {
|
|||
|
||||
// TODO(internal b/160846312): Remove this suppress warnings and call onCurrentMediaItemChanged
|
||||
// with a null item once we depend on media2 1.2.0.
|
||||
@SuppressWarnings("nullness:argument.type.incompatible")
|
||||
private void handlePlaylistChangedOnHandler() {
|
||||
List<MediaItem> currentPlaylist = player.getPlaylist();
|
||||
MediaMetadata playlistMetadata = player.getPlaylistMetadata();
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ public class PlaybackException extends Exception implements Bundleable {
|
|||
protected static final int FIELD_CUSTOM_ID_BASE = 1000;
|
||||
|
||||
/** Object that can create a {@link PlaybackException} from a {@link Bundle}. */
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final Creator<PlaybackException> CREATOR =
|
||||
bundle -> {
|
||||
String className = bundle.getString(keyForField(FIELD_STRING_CLASS_NAME));
|
||||
|
|
@ -375,7 +375,7 @@ public class PlaybackException extends Exception implements Bundleable {
|
|||
try {
|
||||
Field creatorField = Class.forName(className).getField("CREATOR");
|
||||
// It is ok to pass null to Field.get for static fields.
|
||||
@SuppressWarnings({"argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
Creator<PlaybackException> creator =
|
||||
(Creator<PlaybackException>) creatorField.get(/* obj= */ null);
|
||||
if (creator != null) {
|
||||
|
|
@ -414,14 +414,14 @@ public class PlaybackException extends Exception implements Bundleable {
|
|||
}
|
||||
|
||||
// Creates a new {@link Throwable} with possibly {@code null} message.
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
private static Throwable createThrowable(Class<?> clazz, @Nullable String message)
|
||||
throws Exception {
|
||||
return (Throwable) clazz.getConstructor(String.class).newInstance(message);
|
||||
}
|
||||
|
||||
// Creates a new {@link RemoteException} with possibly {@code null} message.
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
private static RemoteException createRemoteException(@Nullable String message) {
|
||||
return new RemoteException(message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ public final class AdPlaybackState implements Bundleable {
|
|||
private static final int FIELD_IS_SERVER_SIDE_INSERTED = 6;
|
||||
|
||||
// putParcelableArrayList actually supports null elements.
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
@Override
|
||||
public Bundle toBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
|
|
@ -359,7 +359,7 @@ public final class AdPlaybackState implements Bundleable {
|
|||
public static final Creator<AdGroup> CREATOR = AdGroup::fromBundle;
|
||||
|
||||
// getParcelableArrayList may have null elements.
|
||||
@SuppressWarnings({"nullness:type.argument.type.incompatible", "nullness:type.argument"})
|
||||
@SuppressWarnings("nullness:type.argument")
|
||||
private static AdGroup fromBundle(Bundle bundle) {
|
||||
long timeUs = bundle.getLong(keyForField(FIELD_TIME_US));
|
||||
int count = bundle.getInt(keyForField(FIELD_COUNT), /* defaultValue= */ C.LENGTH_UNSET);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public abstract class AbstractConcatenatedTimeline extends Timeline {
|
|||
* @param concatenatedUid UID of a period in a concatenated timeline.
|
||||
* @return UID of the child timeline this period belongs to.
|
||||
*/
|
||||
@SuppressWarnings({"nullness:return.type.incompatible", "nullness:return"})
|
||||
@SuppressWarnings("nullness:return")
|
||||
public static Object getChildTimelineUidFromConcatenatedUid(Object concatenatedUid) {
|
||||
return ((Pair<?, ?>) concatenatedUid).first;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ public abstract class AbstractConcatenatedTimeline extends Timeline {
|
|||
* @param concatenatedUid UID of a period in a concatenated timeline.
|
||||
* @return UID of the period in the child timeline.
|
||||
*/
|
||||
@SuppressWarnings({"nullness:return.type.incompatible", "nullness:return"})
|
||||
@SuppressWarnings("nullness:return")
|
||||
public static Object getChildPeriodUidFromConcatenatedUid(Object concatenatedUid) {
|
||||
return ((Pair<?, ?>) concatenatedUid).second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -526,10 +526,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
}
|
||||
|
||||
@EnsuresNonNullIf(result = true, expression = "sessionId")
|
||||
@SuppressWarnings({
|
||||
"contracts.conditional.postcondition.not.satisfied",
|
||||
"nullness:contracts.conditional.postcondition"
|
||||
})
|
||||
@SuppressWarnings("nullness:contracts.conditional.postcondition")
|
||||
private boolean isOpen() {
|
||||
return state == STATE_OPENED || state == STATE_OPENED_WITH_KEYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,10 +161,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
* invocation of {@link Callback#onContinueLoadingRequested(SequenceableLoader)}.
|
||||
*/
|
||||
// maybeFinishPrepare is not posted to the handler until initialization completes.
|
||||
@SuppressWarnings({
|
||||
"nullness:argument.type.incompatible", "nullness:argument",
|
||||
"nullness:methodref.receiver.bound.invalid", "nullness:methodref.receiver.bound"
|
||||
})
|
||||
@SuppressWarnings({"nullness:argument", "nullness:methodref.receiver.bound"})
|
||||
public ProgressiveMediaPeriod(
|
||||
Uri uri,
|
||||
DataSource dataSource,
|
||||
|
|
@ -980,7 +977,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
@Nullable private TrackOutput icyTrackOutput;
|
||||
private boolean seenIcyMetadata;
|
||||
|
||||
@SuppressWarnings({"method.invocation.invalid", "nullness:method.invocation"})
|
||||
@SuppressWarnings("nullness:method.invocation")
|
||||
public ExtractingLoadable(
|
||||
Uri uri,
|
||||
DataSource dataSource,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public final class ServerSideInsertedAdsMediaSource extends BaseMediaSource
|
|||
* @param mediaSource The {@link MediaSource} to wrap.
|
||||
*/
|
||||
// Calling BaseMediaSource.createEventDispatcher from the constructor.
|
||||
@SuppressWarnings({"nullness:method.invocation.invalid", "nullness:method.invocation"})
|
||||
@SuppressWarnings("nullness:method.invocation")
|
||||
public ServerSideInsertedAdsMediaSource(MediaSource mediaSource) {
|
||||
this.mediaSource = mediaSource;
|
||||
mediaPeriods = ArrayListMultimap.create();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public abstract class BaseMediaChunkIterator implements MediaChunkIterator {
|
|||
* @param fromIndex The first available index.
|
||||
* @param toIndex The last available index.
|
||||
*/
|
||||
@SuppressWarnings({"method.invocation.invalid", "nullness:method.invocation"})
|
||||
@SuppressWarnings("nullness:method.invocation")
|
||||
public BaseMediaChunkIterator(long fromIndex, long toIndex) {
|
||||
this.fromIndex = fromIndex;
|
||||
this.toIndex = toIndex;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public abstract class SimpleSubtitleDecoder
|
|||
private final String name;
|
||||
|
||||
/** @param name The name of the decoder. */
|
||||
@SuppressWarnings({"nullness:method.invocation.invalid", "nullness:method.invocation"})
|
||||
@SuppressWarnings("nullness:method.invocation")
|
||||
protected SimpleSubtitleDecoder(String name) {
|
||||
super(new SubtitleInputBuffer[2], new SubtitleOutputBuffer[2]);
|
||||
this.name = name;
|
||||
|
|
|
|||
|
|
@ -42,10 +42,7 @@ import java.util.PriorityQueue;
|
|||
private long playbackPositionUs;
|
||||
private long queuedInputBufferCount;
|
||||
|
||||
@SuppressWarnings({
|
||||
"nullness:methodref.receiver.bound.invalid",
|
||||
"nullness:methodref.receiver.bound"
|
||||
})
|
||||
@SuppressWarnings("nullness:methodref.receiver.bound")
|
||||
public CeaDecoder() {
|
||||
availableInputBuffers = new ArrayDeque<>();
|
||||
for (int i = 0; i < NUM_INPUT_BUFFERS; i++) {
|
||||
|
|
|
|||
|
|
@ -51,11 +51,7 @@ public class TrackSelectionParameters implements Parcelable {
|
|||
*
|
||||
* @param context Any context.
|
||||
*/
|
||||
@SuppressWarnings({
|
||||
"deprecation",
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:method.invocation"
|
||||
})
|
||||
@SuppressWarnings({"deprecation", "nullness:method.invocation"})
|
||||
public Builder(Context context) {
|
||||
this();
|
||||
setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(context);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
|
|||
}
|
||||
|
||||
/** Releases all allocated resources. */
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
public void release() {
|
||||
handler.removeCallbacks(this);
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public abstract class RunnableFutureTask<R, E extends Exception> implements Runn
|
|||
|
||||
// The return value is guaranteed to be non-null if and only if R is a non-null type, but there's
|
||||
// no way to assert this. Suppress the warning instead.
|
||||
@SuppressWarnings({"return.type.incompatible", "nullness:return"})
|
||||
@SuppressWarnings("nullness:return")
|
||||
@UnknownNull
|
||||
private R getResult() throws ExecutionException {
|
||||
if (canceled) {
|
||||
|
|
|
|||
|
|
@ -52,11 +52,7 @@ public final class VideoDecoderGLSurfaceView extends GLSurfaceView
|
|||
* @param context A {@link Context}.
|
||||
* @param attrs Custom attributes.
|
||||
*/
|
||||
@SuppressWarnings({
|
||||
"nullness:assignment.type.incompatible", "nullness:assignment",
|
||||
"nullness:argument.type.incompatible", "nullness:argument",
|
||||
"nullness:method.invocation.invalid", "nullness:method.invocation"
|
||||
})
|
||||
@SuppressWarnings({"nullness:assignment", "nullness:argument", "nullness:method.invocation"})
|
||||
public VideoDecoderGLSurfaceView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
renderer = new Renderer(/* surfaceView= */ this);
|
||||
|
|
|
|||
|
|
@ -69,10 +69,7 @@ import androidx.annotation.BinderThread;
|
|||
// on the sensor thread and read on the UI thread.
|
||||
private volatile float roll;
|
||||
|
||||
@SuppressWarnings({
|
||||
"nullness:assignment.type.incompatible", "nullness:assignment",
|
||||
"nullness:argument.type.incompatible", "nullness:argument"
|
||||
})
|
||||
@SuppressWarnings({"nullness:assignment", "nullness:argument"})
|
||||
public TouchTracker(Context context, Listener listener, float pxPerDegrees) {
|
||||
this.listener = listener;
|
||||
this.pxPerDegrees = pxPerDegrees;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||
static {
|
||||
@Nullable Constructor<? extends Extractor> flacExtensionExtractorConstructor = null;
|
||||
try {
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@SuppressWarnings("nullness:argument")
|
||||
boolean isFlacNativeLibraryAvailable =
|
||||
Boolean.TRUE.equals(
|
||||
Class.forName("com.google.android.exoplayer2.ext.flac.FlacLibrary")
|
||||
|
|
|
|||
|
|
@ -237,16 +237,10 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
readOnlyMediaChunks = Collections.unmodifiableList(mediaChunks);
|
||||
hlsSampleStreams = new ArrayList<>();
|
||||
// Suppressions are needed because `this` is not initialized here.
|
||||
@SuppressWarnings({
|
||||
"nullness:methodref.receiver.bound.invalid",
|
||||
"nullness:methodref.receiver.bound"
|
||||
})
|
||||
@SuppressWarnings("nullness:methodref.receiver.bound")
|
||||
Runnable maybeFinishPrepareRunnable = this::maybeFinishPrepare;
|
||||
this.maybeFinishPrepareRunnable = maybeFinishPrepareRunnable;
|
||||
@SuppressWarnings({
|
||||
"nullness:methodref.receiver.bound.invalid",
|
||||
"nullness:methodref.receiver.bound"
|
||||
})
|
||||
@SuppressWarnings("nullness:methodref.receiver.bound")
|
||||
Runnable onTracksEndedRunnable = this::onTracksEnded;
|
||||
this.onTracksEndedRunnable = onTracksEndedRunnable;
|
||||
handler = Util.createHandlerForCurrentLooper();
|
||||
|
|
|
|||
Loading…
Reference in a new issue