Remove unneeded SDK checks

PiperOrigin-RevId: 750172684
This commit is contained in:
tonihei 2025-04-22 06:47:06 -07:00 committed by Copybara-Service
parent 661effcddd
commit 1c855a8abf
2 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,6 @@
*/ */
package androidx.media3.exoplayer.analytics; package androidx.media3.exoplayer.analytics;
import static android.os.Build.VERSION.SDK_INT;
import static androidx.media3.common.util.Assertions.checkNotNull; import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Util.castNonNull; import static androidx.media3.common.util.Util.castNonNull;
@ -765,7 +764,7 @@ public final class MediaMetricsListener
int subErrorCode = Util.getErrorCodeFromPlatformDiagnosticsInfo(diagnosticsInfo); int subErrorCode = Util.getErrorCodeFromPlatformDiagnosticsInfo(diagnosticsInfo);
int errorCode = getDrmErrorCode(subErrorCode); int errorCode = getDrmErrorCode(subErrorCode);
return new ErrorInfo(errorCode, subErrorCode); return new ErrorInfo(errorCode, subErrorCode);
} else if (SDK_INT >= 23 && cause instanceof MediaDrmResetException) { } else if (cause instanceof MediaDrmResetException) {
return new ErrorInfo(PlaybackErrorEvent.ERROR_DRM_SYSTEM_ERROR, /* subErrorCode= */ 0); return new ErrorInfo(PlaybackErrorEvent.ERROR_DRM_SYSTEM_ERROR, /* subErrorCode= */ 0);
} else if (cause instanceof NotProvisionedException) { } else if (cause instanceof NotProvisionedException) {
return new ErrorInfo( return new ErrorInfo(

View File

@ -88,7 +88,7 @@ public final class LegacyParcelableUtil {
// TODO: b/335804969 - Remove this workaround once the bug fix is in the androidx.media dependency // TODO: b/335804969 - Remove this workaround once the bug fix is in the androidx.media dependency
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private static <T> T maybeApplyMediaDescriptionParcelableBugWorkaround(T value) { private static <T> T maybeApplyMediaDescriptionParcelableBugWorkaround(T value) {
if (SDK_INT < 21 || SDK_INT >= 23) { if (SDK_INT >= 23) {
return value; return value;
} }
if (value instanceof android.support.v4.media.MediaBrowserCompat.MediaItem) { if (value instanceof android.support.v4.media.MediaBrowserCompat.MediaItem) {