Fix some local & comment references is DefaultDrmSessionManager

This field changed name during the code review, but these names and
references weren't updated to match.

Also use an ImmutableSet since the field is a Set.

PiperOrigin-RevId: 353021268
This commit is contained in:
ibaker 2021-01-21 16:06:51 +00:00 committed by kim-vde
parent 20df512c74
commit ba803a2e79

View File

@ -36,6 +36,7 @@ import com.google.android.exoplayer2.util.Log;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
@ -632,12 +633,12 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
// ResourceBusyException is only available at API 19, so on earlier versions we always
// eagerly release regardless of the underlying error.
if (!keepaliveSessions.isEmpty()) {
// Make a local copy, because sessions are removed from this.timingOutSessions during
// Make a local copy, because sessions are removed from this.keepaliveSessions during
// release (via callback).
ImmutableList<DefaultDrmSession> timingOutSessions =
ImmutableList.copyOf(this.keepaliveSessions);
for (DrmSession timingOutSession : timingOutSessions) {
timingOutSession.release(/* eventDispatcher= */ null);
ImmutableSet<DefaultDrmSession> keepaliveSessions =
ImmutableSet.copyOf(this.keepaliveSessions);
for (DrmSession keepaliveSession : keepaliveSessions) {
keepaliveSession.release(/* eventDispatcher= */ null);
}
// Undo the acquisitions from createAndAcquireSession().
session.release(eventDispatcher);