mirror of
https://github.com/samsonjs/media.git
synced 2026-04-06 11:25:46 +00:00
Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999709
This commit is contained in:
parent
483a350e84
commit
755f5b7d76
25 changed files with 193 additions and 25 deletions
|
|
@ -139,7 +139,11 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
@Nullable private RequestHandler requestHandler;
|
||||
@Nullable private ExoMediaCrypto mediaCrypto;
|
||||
@Nullable private DrmSessionException lastException;
|
||||
@Nullable private byte[] sessionId;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private byte[] sessionId;
|
||||
|
||||
private byte @MonotonicNonNull [] offlineLicenseKeySetId;
|
||||
|
||||
@Nullable private KeyRequest currentKeyRequest;
|
||||
|
|
@ -164,6 +168,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
* @param loadErrorHandlingPolicy The {@link LoadErrorHandlingPolicy} for key and provisioning
|
||||
* requests.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public DefaultDrmSession(
|
||||
UUID uuid,
|
||||
ExoMediaDrm mediaDrm,
|
||||
|
|
@ -272,12 +278,16 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
return sessionId == null ? null : mediaDrm.queryKeyStatus(sessionId);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
@Nullable
|
||||
public byte[] getOfflineLicenseKeySetId() {
|
||||
return offlineLicenseKeySetId;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public void acquire(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher) {
|
||||
checkState(referenceCount >= 0);
|
||||
|
|
@ -301,6 +311,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
referenceCountListener.onReferenceCountIncremented(this, referenceCount);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public void release(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher) {
|
||||
checkState(referenceCount > 0);
|
||||
|
|
|
|||
|
|
@ -290,7 +290,10 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
@Nullable private Looper playbackLooper;
|
||||
private @MonotonicNonNull Handler sessionReleasingHandler;
|
||||
private int mode;
|
||||
@Nullable private byte[] offlineLicenseKeySetId;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private byte[] offlineLicenseKeySetId;
|
||||
|
||||
/* package */ volatile @Nullable MediaDrmHandler mediaDrmHandler;
|
||||
|
||||
|
|
@ -430,6 +433,8 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
* @param mode The mode to be set.
|
||||
* @param offlineLicenseKeySetId The key set id of the license to be used with the given mode.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public void setMode(@Mode int mode, @Nullable byte[] offlineLicenseKeySetId) {
|
||||
Assertions.checkState(sessions.isEmpty());
|
||||
if (mode == MODE_QUERY || mode == MODE_RELEASE) {
|
||||
|
|
@ -467,6 +472,8 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
exoMediaDrm = null;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
@Nullable
|
||||
public DrmSession acquireSession(
|
||||
|
|
@ -618,6 +625,8 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
}
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
private DefaultDrmSession createAndAcquireSessionWithRetry(
|
||||
@Nullable List<SchemeData> schemeDatas,
|
||||
boolean isPlaceholderSession,
|
||||
|
|
@ -657,6 +666,8 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
* <p>If {@link #sessionKeepaliveMs} != {@link C#TIME_UNSET} then acquires it again to allow the
|
||||
* manager to keep it alive (passing in {@code eventDispatcher=null}.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
private DefaultDrmSession createAndAcquireSession(
|
||||
@Nullable List<SchemeData> schemeDatas,
|
||||
boolean isPlaceholderSession,
|
||||
|
|
@ -817,6 +828,8 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||
|
||||
private class MediaDrmEventListener implements OnEventListener {
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
public void onEvent(
|
||||
ExoMediaDrm md, @Nullable byte[] sessionId, int event, int extra, @Nullable byte[] data) {
|
||||
|
|
|
|||
|
|
@ -131,6 +131,8 @@ public interface DrmSession {
|
|||
* Returns the key set id of the offline license loaded into this session, or null if there isn't
|
||||
* one.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] getOfflineLicenseKeySetId();
|
||||
|
||||
|
|
@ -142,6 +144,8 @@ public interface DrmSession {
|
|||
* @param eventDispatcher The {@link DrmSessionEventListener.EventDispatcher} used to route
|
||||
* DRM-related events dispatched from this session, or null if no event handling is needed.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
void acquire(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher);
|
||||
|
||||
/**
|
||||
|
|
@ -152,5 +156,7 @@ public interface DrmSession {
|
|||
* the session is released (the same instance (possibly null) that was passed by the caller to
|
||||
* {@link #acquire(DrmSessionEventListener.EventDispatcher)}).
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
void release(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public interface DrmSessionManager {
|
|||
DrmSessionManager DUMMY =
|
||||
new DrmSessionManager() {
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
@Nullable
|
||||
public DrmSession acquireSession(
|
||||
|
|
@ -89,6 +91,8 @@ public interface DrmSessionManager {
|
|||
* @param format The {@link Format} for which to acquire a {@link DrmSession}.
|
||||
* @return The DRM session. May be null if the given {@link Format#drmInitData} is null.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
DrmSession acquireSession(
|
||||
Looper playbackLooper,
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ public final class DummyExoMediaDrm implements ExoMediaDrm {
|
|||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
@Nullable
|
||||
public byte[] provideKeyResponse(byte[] scope, byte[] response) {
|
||||
|
|
|
|||
|
|
@ -63,17 +63,23 @@ public final class ErrorStateDrmSession implements DrmSession {
|
|||
return null;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
@Nullable
|
||||
public byte[] getOfflineLicenseKeySetId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public void acquire(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public void release(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher) {
|
||||
// Do nothing.
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ public interface ExoMediaDrm {
|
|||
* @param extra A secondary error code.
|
||||
* @param data Optional byte array of data that may be associated with the event.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
void onEvent(
|
||||
ExoMediaDrm mediaDrm,
|
||||
@Nullable byte[] sessionId,
|
||||
|
|
@ -294,6 +296,8 @@ public interface ExoMediaDrm {
|
|||
throws NotProvisionedException;
|
||||
|
||||
/** @see MediaDrm#provideKeyResponse(byte[], byte[]) */
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] provideKeyResponse(byte[] scope, byte[] response)
|
||||
throws NotProvisionedException, DeniedByServerException;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||
}
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public void setOnEventListener(@Nullable ExoMediaDrm.OnEventListener listener) {
|
||||
mediaDrm.setOnEventListener(
|
||||
|
|
@ -127,6 +129,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||
* @param listener The listener to receive events, or {@code null} to stop receiving events.
|
||||
* @throws UnsupportedOperationException on API levels lower than 23.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
@RequiresApi(23)
|
||||
public void setOnKeyStatusChangeListener(
|
||||
|
|
@ -213,6 +217,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||
return new KeyRequest(requestData, licenseServerUrl);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
@Nullable
|
||||
public byte[] provideKeyResponse(byte[] scope, byte[] response)
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
|||
return executePost(dataSourceFactory, url, request.getData(), requestProperties);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
private static byte[] executePost(
|
||||
HttpDataSource.Factory dataSourceFactory,
|
||||
String url,
|
||||
|
|
|
|||
|
|
@ -262,6 +262,8 @@ public final class OfflineLicenseHelper {
|
|||
handlerThread.quit();
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
private byte[] blockingKeyRequest(
|
||||
@Mode int licenseMode, @Nullable byte[] offlineLicenseKeySetId, Format format)
|
||||
throws DrmSessionException {
|
||||
|
|
@ -277,6 +279,8 @@ public final class OfflineLicenseHelper {
|
|||
return Assertions.checkNotNull(keySetId);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
private DrmSession openBlockingKeyRequest(
|
||||
@Mode int licenseMode, @Nullable byte[] offlineLicenseKeySetId, Format format) {
|
||||
Assertions.checkNotNull(format.drmInitData);
|
||||
|
|
|
|||
|
|
@ -222,8 +222,14 @@ public class DefaultTimeBar extends View implements TimeBar {
|
|||
private long position;
|
||||
private long bufferedPosition;
|
||||
private int adGroupCount;
|
||||
@Nullable private long[] adGroupTimesMs;
|
||||
@Nullable private boolean[] playedAdGroups;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private long[] adGroupTimesMs;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private boolean[] playedAdGroups;
|
||||
|
||||
public DefaultTimeBar(Context context) {
|
||||
this(context, null);
|
||||
|
|
@ -527,9 +533,11 @@ public class DefaultTimeBar extends View implements TimeBar {
|
|||
: duration / timeBarWidthDp;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
public void setAdGroupTimesMs(@Nullable long[] adGroupTimesMs, @Nullable boolean[] playedAdGroups,
|
||||
int adGroupCount) {
|
||||
public void setAdGroupTimesMs(
|
||||
@Nullable long[] adGroupTimesMs, @Nullable boolean[] playedAdGroups, int adGroupCount) {
|
||||
Assertions.checkArgument(adGroupCount == 0
|
||||
|| (adGroupTimesMs != null && playedAdGroups != null));
|
||||
this.adGroupCount = adGroupCount;
|
||||
|
|
|
|||
|
|
@ -568,6 +568,8 @@ public class PlayerControlView extends FrameLayout {
|
|||
* @param extraPlayedAdGroups Whether each ad has been played. Must be the same length as {@code
|
||||
* extraAdGroupTimesMs}, or {@code null} if {@code extraAdGroupTimesMs} is {@code null}.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public void setExtraAdGroupMarkers(
|
||||
@Nullable long[] extraAdGroupTimesMs, @Nullable boolean[] extraPlayedAdGroups) {
|
||||
if (extraAdGroupTimesMs == null) {
|
||||
|
|
|
|||
|
|
@ -373,7 +373,11 @@ public class PlayerNotificationManager {
|
|||
private final int instanceId;
|
||||
private final Timeline.Window window;
|
||||
|
||||
@Nullable private NotificationCompat.Builder builder;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private NotificationCompat.Builder builder;
|
||||
|
||||
@Nullable private List<NotificationCompat.Action> builderActions;
|
||||
@Nullable private Player player;
|
||||
@Nullable private PlaybackPreparer playbackPreparer;
|
||||
|
|
@ -381,7 +385,11 @@ public class PlayerNotificationManager {
|
|||
private boolean isNotificationStarted;
|
||||
private int currentNotificationTag;
|
||||
@Nullable private NotificationListener notificationListener;
|
||||
@Nullable private MediaSessionCompat.Token mediaSessionToken;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private MediaSessionCompat.Token mediaSessionToken;
|
||||
|
||||
private boolean useNavigationActions;
|
||||
private boolean useNavigationActionsInCompactView;
|
||||
private boolean usePlayPauseActions;
|
||||
|
|
@ -1039,6 +1047,8 @@ public class PlayerNotificationManager {
|
|||
* NotificationCompat.Builder#build()} to obtain the notification, or {@code null} if no
|
||||
* notification should be displayed.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
protected NotificationCompat.Builder createNotification(
|
||||
Player player,
|
||||
|
|
@ -1054,6 +1064,8 @@ public class PlayerNotificationManager {
|
|||
List<NotificationCompat.Action> actions = new ArrayList<>(actionNames.size());
|
||||
for (int i = 0; i < actionNames.size(); i++) {
|
||||
String actionName = actionNames.get(i);
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
NotificationCompat.Action action =
|
||||
playbackActions.containsKey(actionName)
|
||||
|
|
|
|||
|
|
@ -309,7 +309,11 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
|
||||
@Nullable private Player player;
|
||||
private boolean useController;
|
||||
@Nullable private PlayerControlView.VisibilityListener controllerVisibilityListener;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private PlayerControlView.VisibilityListener controllerVisibilityListener;
|
||||
|
||||
private boolean useArtwork;
|
||||
@Nullable private Drawable defaultArtwork;
|
||||
private @ShowBuffering int showBuffering;
|
||||
|
|
@ -564,7 +568,10 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
@Nullable Player oldPlayer = this.player;
|
||||
if (oldPlayer != null) {
|
||||
oldPlayer.removeListener(componentListener);
|
||||
@Nullable Player.VideoComponent oldVideoComponent = oldPlayer.getVideoComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.VideoComponent oldVideoComponent = oldPlayer.getVideoComponent();
|
||||
if (oldVideoComponent != null) {
|
||||
oldVideoComponent.removeVideoListener(componentListener);
|
||||
if (surfaceView instanceof TextureView) {
|
||||
|
|
@ -577,7 +584,10 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
oldVideoComponent.clearVideoSurfaceView((SurfaceView) surfaceView);
|
||||
}
|
||||
}
|
||||
@Nullable Player.TextComponent oldTextComponent = oldPlayer.getTextComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.TextComponent oldTextComponent = oldPlayer.getTextComponent();
|
||||
if (oldTextComponent != null) {
|
||||
oldTextComponent.removeTextOutput(componentListener);
|
||||
}
|
||||
|
|
@ -593,7 +603,10 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
updateErrorMessage();
|
||||
updateForCurrentTrackSelections(/* isNewPlayer= */ true);
|
||||
if (player != null) {
|
||||
@Nullable Player.VideoComponent newVideoComponent = player.getVideoComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.VideoComponent newVideoComponent = player.getVideoComponent();
|
||||
if (newVideoComponent != null) {
|
||||
if (surfaceView instanceof TextureView) {
|
||||
newVideoComponent.setVideoTextureView((TextureView) surfaceView);
|
||||
|
|
@ -607,7 +620,10 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
}
|
||||
newVideoComponent.addVideoListener(componentListener);
|
||||
}
|
||||
@Nullable Player.TextComponent newTextComponent = player.getTextComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.TextComponent newTextComponent = player.getTextComponent();
|
||||
if (newTextComponent != null) {
|
||||
newTextComponent.addTextOutput(componentListener);
|
||||
if (subtitleView != null) {
|
||||
|
|
@ -966,6 +982,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
* @param listener The listener to be notified about visibility changes, or null to remove the
|
||||
* current listener.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setControllerVisibilityListener(
|
||||
@Nullable PlayerControlView.VisibilityListener listener) {
|
||||
Assertions.checkStateNotNull(controller);
|
||||
|
|
@ -1108,6 +1126,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
* @param extraPlayedAdGroups Whether each ad has been played, or {@code null} to show no extra ad
|
||||
* markers.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public void setExtraAdGroupMarkers(
|
||||
@Nullable long[] extraAdGroupTimesMs, @Nullable boolean[] extraPlayedAdGroups) {
|
||||
Assertions.checkStateNotNull(controller);
|
||||
|
|
@ -1120,6 +1140,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
* @param listener The listener to be notified about aspect ratios changes of the video content or
|
||||
* the content frame.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setAspectRatioListener(
|
||||
@Nullable AspectRatioFrameLayout.AspectRatioListener listener) {
|
||||
Assertions.checkStateNotNull(contentFrame);
|
||||
|
|
|
|||
|
|
@ -791,6 +791,8 @@ public class StyledPlayerControlView extends FrameLayout {
|
|||
* @param extraPlayedAdGroups Whether each ad has been played. Must be the same length as {@code
|
||||
* extraAdGroupTimesMs}, or {@code null} if {@code extraAdGroupTimesMs} is {@code null}.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public void setExtraAdGroupMarkers(
|
||||
@Nullable long[] extraAdGroupTimesMs, @Nullable boolean[] extraPlayedAdGroups) {
|
||||
if (extraAdGroupTimesMs == null) {
|
||||
|
|
|
|||
|
|
@ -311,7 +311,11 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
|
||||
@Nullable private Player player;
|
||||
private boolean useController;
|
||||
@Nullable private StyledPlayerControlView.VisibilityListener controllerVisibilityListener;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private StyledPlayerControlView.VisibilityListener controllerVisibilityListener;
|
||||
|
||||
private boolean useArtwork;
|
||||
@Nullable private Drawable defaultArtwork;
|
||||
private @ShowBuffering int showBuffering;
|
||||
|
|
@ -573,7 +577,10 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
@Nullable Player oldPlayer = this.player;
|
||||
if (oldPlayer != null) {
|
||||
oldPlayer.removeListener(componentListener);
|
||||
@Nullable Player.VideoComponent oldVideoComponent = oldPlayer.getVideoComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.VideoComponent oldVideoComponent = oldPlayer.getVideoComponent();
|
||||
if (oldVideoComponent != null) {
|
||||
oldVideoComponent.removeVideoListener(componentListener);
|
||||
if (surfaceView instanceof TextureView) {
|
||||
|
|
@ -586,7 +593,10 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
oldVideoComponent.clearVideoSurfaceView((SurfaceView) surfaceView);
|
||||
}
|
||||
}
|
||||
@Nullable Player.TextComponent oldTextComponent = oldPlayer.getTextComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.TextComponent oldTextComponent = oldPlayer.getTextComponent();
|
||||
if (oldTextComponent != null) {
|
||||
oldTextComponent.removeTextOutput(componentListener);
|
||||
}
|
||||
|
|
@ -602,7 +612,10 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
updateErrorMessage();
|
||||
updateForCurrentTrackSelections(/* isNewPlayer= */ true);
|
||||
if (player != null) {
|
||||
@Nullable Player.VideoComponent newVideoComponent = player.getVideoComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.VideoComponent newVideoComponent = player.getVideoComponent();
|
||||
if (newVideoComponent != null) {
|
||||
if (surfaceView instanceof TextureView) {
|
||||
newVideoComponent.setVideoTextureView((TextureView) surfaceView);
|
||||
|
|
@ -616,7 +629,10 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
}
|
||||
newVideoComponent.addVideoListener(componentListener);
|
||||
}
|
||||
@Nullable Player.TextComponent newTextComponent = player.getTextComponent();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Player.TextComponent newTextComponent = player.getTextComponent();
|
||||
if (newTextComponent != null) {
|
||||
newTextComponent.addTextOutput(componentListener);
|
||||
if (subtitleView != null) {
|
||||
|
|
@ -950,6 +966,8 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
* @param listener The listener to be notified about visibility changes, or null to remove the
|
||||
* current listener.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setControllerVisibilityListener(
|
||||
@Nullable StyledPlayerControlView.VisibilityListener listener) {
|
||||
Assertions.checkStateNotNull(controller);
|
||||
|
|
@ -971,6 +989,8 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
* @param listener The listener to be notified when the fullscreen button is clicked, or null to
|
||||
* remove the current listener and hide the fullscreen button.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setControllerOnFullScreenModeChangedListener(
|
||||
@Nullable StyledPlayerControlView.OnFullScreenModeChangedListener listener) {
|
||||
Assertions.checkStateNotNull(controller);
|
||||
|
|
@ -1102,6 +1122,8 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
* @param extraPlayedAdGroups Whether each ad has been played, or {@code null} to show no extra ad
|
||||
* markers.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public void setExtraAdGroupMarkers(
|
||||
@Nullable long[] extraAdGroupTimesMs, @Nullable boolean[] extraPlayedAdGroups) {
|
||||
Assertions.checkStateNotNull(controller);
|
||||
|
|
@ -1114,6 +1136,8 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
|
|||
* @param listener The listener to be notified about aspect ratios changes of the video content or
|
||||
* the content frame.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setAspectRatioListener(
|
||||
@Nullable AspectRatioFrameLayout.AspectRatioListener listener) {
|
||||
Assertions.checkStateNotNull(contentFrame);
|
||||
|
|
|
|||
|
|
@ -102,8 +102,10 @@ public interface TimeBar {
|
|||
* groups.
|
||||
* @param adGroupCount The number of ad groups.
|
||||
*/
|
||||
void setAdGroupTimesMs(@Nullable long[] adGroupTimesMs, @Nullable boolean[] playedAdGroups,
|
||||
int adGroupCount);
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
void setAdGroupTimesMs(
|
||||
@Nullable long[] adGroupTimesMs, @Nullable boolean[] playedAdGroups, int adGroupCount);
|
||||
|
||||
/**
|
||||
* Listener for scrubbing events.
|
||||
|
|
|
|||
|
|
@ -374,6 +374,8 @@ import java.util.Map;
|
|||
}
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
private static String convertAlignmentToCss(@Nullable Layout.Alignment alignment) {
|
||||
if (alignment == null) {
|
||||
return "center";
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ public final class CapturingAudioSink extends ForwardingAudioSink implements Dum
|
|||
interceptedData = new ArrayList<>();
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels)
|
||||
throws ConfigurationException {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,11 @@ public final class DownloadBuilder {
|
|||
private Uri uri;
|
||||
@Nullable private String mimeType;
|
||||
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 cacheKey;
|
||||
private byte[] customMetadata;
|
||||
|
||||
|
|
@ -85,6 +89,8 @@ public final class DownloadBuilder {
|
|||
}
|
||||
|
||||
/** Creates a download builder. */
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
private DownloadBuilder(
|
||||
String id,
|
||||
Uri uri,
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public final class Dumper {
|
|||
return this;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public Dumper add(String field, @Nullable byte[] value) {
|
||||
String string =
|
||||
String.format(
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ public class FakeDataSet {
|
|||
public static final class Segment {
|
||||
|
||||
@Nullable public final IOException exception;
|
||||
@Nullable public final byte[] data;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
public final byte[] data;
|
||||
|
||||
public final int length;
|
||||
public final long byteOffset;
|
||||
@Nullable public final Runnable action;
|
||||
|
|
@ -105,6 +109,8 @@ public class FakeDataSet {
|
|||
this(null, 0, null, action, previousSegment);
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
private Segment(
|
||||
@Nullable byte[] data,
|
||||
int length,
|
||||
|
|
|
|||
|
|
@ -170,6 +170,8 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||
return new KeyRequest(requestData.toByteArray(), /* licenseServerUrl= */ "");
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
@Override
|
||||
public byte[] provideKeyResponse(byte[] scope, byte[] response)
|
||||
|
|
@ -243,7 +245,10 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||
@Override
|
||||
public byte[] getPropertyByteArray(String propertyName) {
|
||||
Assertions.checkState(referenceCount > 0);
|
||||
@Nullable byte[] value = byteProperties.get(propertyName);
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] value = byteProperties.get(propertyName);
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("Unrecognized propertyName: " + propertyName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,11 @@ public class FakeMediaSource extends BaseMediaSource {
|
|||
private static final int MANIFEST_LOAD_BYTES = 100;
|
||||
|
||||
private final TrackGroupArray trackGroupArray;
|
||||
@Nullable private final FakeMediaPeriod.TrackDataFactory trackDataFactory;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private final FakeMediaPeriod.TrackDataFactory trackDataFactory;
|
||||
|
||||
private final ArrayList<FakeMediaPeriod> activeMediaPeriods;
|
||||
private final ArrayList<MediaPeriodId> createdMediaPeriods;
|
||||
private final DrmSessionManager drmSessionManager;
|
||||
|
|
@ -121,6 +125,8 @@ public class FakeMediaSource extends BaseMediaSource {
|
|||
* null to prevent an immediate source info refresh message when preparing the media source. It
|
||||
* can be manually set later using {@link #setNewSourceInfo(Timeline)}.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public FakeMediaSource(
|
||||
@Nullable Timeline timeline,
|
||||
DrmSessionManager drmSessionManager,
|
||||
|
|
@ -136,6 +142,8 @@ public class FakeMediaSource extends BaseMediaSource {
|
|||
* immediate source info refresh message when preparing the media source. It can be manually set
|
||||
* later using {@link #setNewSourceInfo(Timeline)}.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public FakeMediaSource(
|
||||
@Nullable Timeline timeline,
|
||||
DrmSessionManager drmSessionManager,
|
||||
|
|
|
|||
|
|
@ -126,7 +126,11 @@ public class FakeSampleStream implements SampleStream {
|
|||
}
|
||||
}
|
||||
|
||||
@Nullable private final MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private final MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher;
|
||||
|
||||
private final Format initialFormat;
|
||||
private final List<FakeSampleStreamItem> fakeSampleStreamItems;
|
||||
private final DrmSessionManager drmSessionManager;
|
||||
|
|
@ -153,6 +157,8 @@ public class FakeSampleStream implements SampleStream {
|
|||
* return every time readData is called. This should usually end with {@link
|
||||
* FakeSampleStreamItem#END_OF_STREAM_ITEM}.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public FakeSampleStream(
|
||||
@Nullable MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher,
|
||||
DrmSessionManager drmSessionManager,
|
||||
|
|
|
|||
Loading…
Reference in a new issue