From 6995d9fde61ac761c2192d33e4af64d764dc25a3 Mon Sep 17 00:00:00 2001 From: dhk2 Date: Fri, 3 Jul 2020 16:02:57 -0700 Subject: [PATCH] adding controls to exit pip or switch to background audio --- .../net/schueller/peertube/activity/VideoPlayActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java index 091a6f0..71b8924 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -76,7 +76,7 @@ public class VideoPlayActivity extends AppCompatActivity { private static boolean floatMode = false; private static final int REQUEST_CODE = 101; private BroadcastReceiver receiver; - //This can only be called when in entering pip mode which can only happen on a high enough level to support pip mode. + //This can only be called when in entering pip mode which can't happen if the device doesn't support pip mode. @SuppressLint("NewApi") public void setActions(String actionCommand) { @@ -84,8 +84,8 @@ public class VideoPlayActivity extends AppCompatActivity { Intent actionIntent = new Intent(BACKGROUND_AUDIO); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), REQUEST_CODE, actionIntent, 0); - @SuppressLint("NewApi") Icon icon = Icon.createWithResource(getApplicationContext(), android.R.drawable.stat_sys_speakerphone); - @SuppressLint("NewApi") RemoteAction remoteAction = new RemoteAction(icon, "close pip", "from pip window custom command", pendingIntent); + @SuppressLint({"NewApi", "LocalSuppress"}) Icon icon = Icon.createWithResource(getApplicationContext(), android.R.drawable.stat_sys_speakerphone); + @SuppressLint({"NewApi", "LocalSuppress"}) RemoteAction remoteAction = new RemoteAction(icon, "close pip", "from pip window custom command", pendingIntent); actions.add(remoteAction); actionIntent = new Intent(ACTION_STOP);