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
This commit is contained in:
parent
2714fb0241
commit
622a44dce0
@ -325,6 +325,7 @@ public class PlayerActivity extends AppCompatActivity
|
|||||||
|
|
||||||
if (!Util.checkCleartextTrafficPermitted(mediaItem)) {
|
if (!Util.checkCleartextTrafficPermitted(mediaItem)) {
|
||||||
showToast(R.string.error_cleartext_not_permitted);
|
showToast(R.string.error_cleartext_not_permitted);
|
||||||
|
finish();
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
if (Util.maybeRequestReadExternalStoragePermission(/* activity= */ this, mediaItem)) {
|
if (Util.maybeRequestReadExternalStoragePermission(/* activity= */ this, mediaItem)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user