From 622a44dce070e36e755c29e2ccd62ca4dbc15652 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 19 Nov 2020 12:27:53 +0000 Subject: [PATCH] Finish PlayerActivity if cleartext not permitted This is inline with other show-toast-on-error cases in this method, and avoids leaving the user on a completely black screen. Note that the maybeRequestReadExternalStoragePermission is an exception because it's not actually an error case. #minor-release PiperOrigin-RevId: 343264869 --- .../java/com/google/android/exoplayer2/demo/PlayerActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java b/demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java index 1e7168d89e..465471a405 100644 --- a/demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java +++ b/demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java @@ -325,6 +325,7 @@ public class PlayerActivity extends AppCompatActivity if (!Util.checkCleartextTrafficPermitted(mediaItem)) { showToast(R.string.error_cleartext_not_permitted); + finish(); return Collections.emptyList(); } if (Util.maybeRequestReadExternalStoragePermission(/* activity= */ this, mediaItem)) {