Commit e4556d76 by ibaker Committed by Ian Baker

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
parent 2a287384
...@@ -17,6 +17,7 @@ package androidx.media3.demo.main; ...@@ -17,6 +17,7 @@ package androidx.media3.demo.main;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Pair; import android.util.Pair;
import android.view.KeyEvent; import android.view.KeyEvent;
...@@ -142,7 +143,7 @@ public class PlayerActivity extends AppCompatActivity ...@@ -142,7 +143,7 @@ public class PlayerActivity extends AppCompatActivity
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if (Util.SDK_INT > 23) { if (Build.VERSION.SDK_INT > 23) {
initializePlayer(); initializePlayer();
if (playerView != null) { if (playerView != null) {
playerView.onResume(); playerView.onResume();
...@@ -153,7 +154,7 @@ public class PlayerActivity extends AppCompatActivity ...@@ -153,7 +154,7 @@ public class PlayerActivity extends AppCompatActivity
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (Util.SDK_INT <= 23 || player == null) { if (Build.VERSION.SDK_INT <= 23 || player == null) {
initializePlayer(); initializePlayer();
if (playerView != null) { if (playerView != null) {
playerView.onResume(); playerView.onResume();
...@@ -164,7 +165,7 @@ public class PlayerActivity extends AppCompatActivity ...@@ -164,7 +165,7 @@ public class PlayerActivity extends AppCompatActivity
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
if (Util.SDK_INT <= 23) { if (Build.VERSION.SDK_INT <= 23) {
if (playerView != null) { if (playerView != null) {
playerView.onPause(); playerView.onPause();
} }
...@@ -175,7 +176,7 @@ public class PlayerActivity extends AppCompatActivity ...@@ -175,7 +176,7 @@ public class PlayerActivity extends AppCompatActivity
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
if (Util.SDK_INT > 23) { if (Build.VERSION.SDK_INT > 23) {
if (playerView != null) { if (playerView != null) {
playerView.onPause(); playerView.onPause();
} }
...@@ -342,7 +343,7 @@ public class PlayerActivity extends AppCompatActivity ...@@ -342,7 +343,7 @@ public class PlayerActivity extends AppCompatActivity
MediaItem.DrmConfiguration drmConfiguration = mediaItem.localConfiguration.drmConfiguration; MediaItem.DrmConfiguration drmConfiguration = mediaItem.localConfiguration.drmConfiguration;
if (drmConfiguration != null) { if (drmConfiguration != null) {
if (Util.SDK_INT < 18) { if (Build.VERSION.SDK_INT < 18) {
showToast(R.string.error_drm_unsupported_before_api_18); showToast(R.string.error_drm_unsupported_before_api_18);
finish(); finish();
return Collections.emptyList(); return Collections.emptyList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment