mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove warning suppression.
This was added in 9609af3c23
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
This commit is contained in:
parent
3ea694b1fb
commit
1dd96cd8fb
@ -52,7 +52,6 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
/**
|
||||
* A {@link DrmSessionManager} that supports playbacks using {@link ExoMediaDrm}.
|
||||
@ -483,8 +482,6 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
||||
exoMediaDrm = null;
|
||||
}
|
||||
|
||||
// precondition of preacquiredSessionReference.acquire is not satisfied.
|
||||
@SuppressWarnings("nullness:contracts.precondition.not.satisfied")
|
||||
@Override
|
||||
public DrmSessionReference preacquireSession(
|
||||
Looper playbackLooper,
|
||||
@ -943,23 +940,23 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
||||
*
|
||||
* <p>Must be called at most once. Can be called from any thread.
|
||||
*/
|
||||
@RequiresNonNull("playbackHandler")
|
||||
public void acquire(Format format) {
|
||||
playbackHandler.post(
|
||||
() -> {
|
||||
if (prepareCallsCount == 0 || isReleased) {
|
||||
// The manager has been fully released or this reference has already been released.
|
||||
// Abort the acquisition attempt.
|
||||
return;
|
||||
}
|
||||
this.session =
|
||||
acquireSession(
|
||||
checkNotNull(playbackLooper),
|
||||
eventDispatcher,
|
||||
format,
|
||||
/* shouldReleasePreacquiredSessionsBeforeRetrying= */ false);
|
||||
preacquiredSessionReferences.add(this);
|
||||
});
|
||||
checkNotNull(playbackHandler)
|
||||
.post(
|
||||
() -> {
|
||||
if (prepareCallsCount == 0 || isReleased) {
|
||||
// The manager has been fully released or this reference has already been
|
||||
// released. Abort the acquisition attempt.
|
||||
return;
|
||||
}
|
||||
this.session =
|
||||
acquireSession(
|
||||
checkNotNull(playbackLooper),
|
||||
eventDispatcher,
|
||||
format,
|
||||
/* shouldReleasePreacquiredSessionsBeforeRetrying= */ false);
|
||||
preacquiredSessionReferences.add(this);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user