From e4556d76a992af5085ae673b8902be8459334f60 Mon Sep 17 00:00:00 2001 From: ibaker Date: Mon, 28 Mar 2022 17:26:03 +0100 Subject: [PATCH] Replace Util.SDK_INT with Build.VERSION.SDK_INT in the demo app Util.SDK_INT will not be part of the stable API. This change only touches those parts of the main demo app that will not be opted-in to the unstable API for other reasons (e.g. download use-cases). PiperOrigin-RevId: 437777687 --- .../androidx/media3/demo/main/PlayerActivity.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java b/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java index d158059a9f..ed33dea550 100644 --- a/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java +++ b/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java @@ -17,6 +17,7 @@ package androidx.media3.demo.main; import android.content.Intent; import android.content.pm.PackageManager; +import android.os.Build; import android.os.Bundle; import android.util.Pair; import android.view.KeyEvent; @@ -142,7 +143,7 @@ public class PlayerActivity extends AppCompatActivity @Override public void onStart() { super.onStart(); - if (Util.SDK_INT > 23) { + if (Build.VERSION.SDK_INT > 23) { initializePlayer(); if (playerView != null) { playerView.onResume(); @@ -153,7 +154,7 @@ public class PlayerActivity extends AppCompatActivity @Override public void onResume() { super.onResume(); - if (Util.SDK_INT <= 23 || player == null) { + if (Build.VERSION.SDK_INT <= 23 || player == null) { initializePlayer(); if (playerView != null) { playerView.onResume(); @@ -164,7 +165,7 @@ public class PlayerActivity extends AppCompatActivity @Override public void onPause() { super.onPause(); - if (Util.SDK_INT <= 23) { + if (Build.VERSION.SDK_INT <= 23) { if (playerView != null) { playerView.onPause(); } @@ -175,7 +176,7 @@ public class PlayerActivity extends AppCompatActivity @Override public void onStop() { super.onStop(); - if (Util.SDK_INT > 23) { + if (Build.VERSION.SDK_INT > 23) { if (playerView != null) { playerView.onPause(); } @@ -342,7 +343,7 @@ public class PlayerActivity extends AppCompatActivity MediaItem.DrmConfiguration drmConfiguration = mediaItem.localConfiguration.drmConfiguration; if (drmConfiguration != null) { - if (Util.SDK_INT < 18) { + if (Build.VERSION.SDK_INT < 18) { showToast(R.string.error_drm_unsupported_before_api_18); finish(); return Collections.emptyList();