Commit 1dd96cd8 by tonihei Committed by marcbaechinger

Remove warning suppression.

This was added in https://github.com/google/ExoPlayer/commit/9609af3c23383f2fd5571662d271c3013875705d as part of a LSC.

The RequiresNonNull annotation doesn't work anymore (it doesn't
recognize the outer class member and instead tries to find
the same variable on the inner class). So instead of suppressing
the warning of the non-fulfilled precondition, we can just
check the non-nullness directly and remove the precondition.

PiperOrigin-RevId: 367593941
parent 3ea694b1
...@@ -52,7 +52,6 @@ import java.util.Set; ...@@ -52,7 +52,6 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/** /**
* A {@link DrmSessionManager} that supports playbacks using {@link ExoMediaDrm}. * A {@link DrmSessionManager} that supports playbacks using {@link ExoMediaDrm}.
...@@ -483,8 +482,6 @@ public class DefaultDrmSessionManager implements DrmSessionManager { ...@@ -483,8 +482,6 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
exoMediaDrm = null; exoMediaDrm = null;
} }
// precondition of preacquiredSessionReference.acquire is not satisfied.
@SuppressWarnings("nullness:contracts.precondition.not.satisfied")
@Override @Override
public DrmSessionReference preacquireSession( public DrmSessionReference preacquireSession(
Looper playbackLooper, Looper playbackLooper,
...@@ -943,13 +940,13 @@ public class DefaultDrmSessionManager implements DrmSessionManager { ...@@ -943,13 +940,13 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
* *
* <p>Must be called at most once. Can be called from any thread. * <p>Must be called at most once. Can be called from any thread.
*/ */
@RequiresNonNull("playbackHandler")
public void acquire(Format format) { public void acquire(Format format) {
playbackHandler.post( checkNotNull(playbackHandler)
.post(
() -> { () -> {
if (prepareCallsCount == 0 || isReleased) { if (prepareCallsCount == 0 || isReleased) {
// The manager has been fully released or this reference has already been released. // The manager has been fully released or this reference has already been
// Abort the acquisition attempt. // released. Abort the acquisition attempt.
return; return;
} }
this.session = this.session =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment