diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/DrmUtil.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/DrmUtil.java index ee2870c1aa..5da5817446 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/DrmUtil.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/DrmUtil.java @@ -80,13 +80,13 @@ public final class DrmUtil { return Api21.mediaDrmStateExceptionToErrorCode(exception); } else if (Util.SDK_INT >= 23 && Api23.isMediaDrmResetException(exception)) { return PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR; - } else if (Api18.isNotProvisionedException(exception)) { + } else if (exception instanceof NotProvisionedException) { return PlaybackException.ERROR_CODE_DRM_PROVISIONING_FAILED; - } else if (Api18.isDeniedByServerException(exception)) { + } else if (exception instanceof DeniedByServerException) { return PlaybackException.ERROR_CODE_DRM_DEVICE_REVOKED; } else if (exception instanceof UnsupportedDrmException) { return PlaybackException.ERROR_CODE_DRM_SCHEME_UNSUPPORTED; - } else if (Api18.isMissingSchemeDataException(exception)) { + } else if (exception instanceof DefaultDrmSessionManager.MissingSchemeDataException) { return PlaybackException.ERROR_CODE_DRM_CONTENT_ERROR; } else if (exception instanceof KeysExpiredException) { return PlaybackException.ERROR_CODE_DRM_LICENSE_EXPIRED; @@ -106,24 +106,6 @@ public final class DrmUtil { // Internal classes. - private static final class Api18 { - - @DoNotInline - public static boolean isNotProvisionedException(@Nullable Throwable throwable) { - return throwable instanceof NotProvisionedException; - } - - @DoNotInline - public static boolean isDeniedByServerException(@Nullable Throwable throwable) { - return throwable instanceof DeniedByServerException; - } - - @DoNotInline - public static boolean isMissingSchemeDataException(@Nullable Throwable throwable) { - return throwable instanceof DefaultDrmSessionManager.MissingSchemeDataException; - } - } - @RequiresApi(21) private static final class Api21 { diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoFrameReleaseHelper.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoFrameReleaseHelper.java index b259334e0f..cf7df55bea 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoFrameReleaseHelper.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoFrameReleaseHelper.java @@ -172,7 +172,7 @@ public final class VideoFrameReleaseHelper { * @param surface The new {@link Surface}, or {@code null} if the renderer does not have one. */ public void onSurfaceChanged(@Nullable Surface surface) { - if (Api17.isPlaceholderSurface(surface)) { + if (surface instanceof PlaceholderSurface) { // We don't care about dummy surfaces for release timing, since they're not visible. surface = null; } @@ -650,12 +650,4 @@ public final class VideoFrameReleaseHelper { } } } - - private static final class Api17 { - - @DoNotInline - public static boolean isPlaceholderSurface(@Nullable Surface surface) { - return surface instanceof PlaceholderSurface; - } - } }