From aebc62d1364c6c4578f6b43802dbad7b01eee409 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 22 Nov 2020 18:20:10 -0800 Subject: [PATCH] only show the play button for non-car mode, since that is taken care of already --- .../core/service/playback/PlaybackService.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index ab989c44b..3e4fccba5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -1224,6 +1224,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } UiModeManager uiModeManager = (UiModeManager) getApplicationContext().getSystemService(Context.UI_MODE_SERVICE); + // if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) { sessionState.addCustomAction( new PlaybackStateCompat.CustomAction.Builder( @@ -1235,17 +1236,20 @@ public class PlaybackService extends MediaBrowserServiceCompat { CUSTOM_ACTION_FAST_FORWARD, getString(R.string.fast_forward_label), R.drawable.ic_notification_fast_forward) .build()); + } else { + // This would give the PIP of videos a play button + capabilities = capabilities | PlaybackStateCompat.ACTION_PLAY; + if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_WATCH) { + flavorHelper.sessionStateAddActionForWear(sessionState, + CUSTOM_ACTION_REWIND, getString(R.string.rewind_label), android.R.drawable.ic_media_rew); + flavorHelper.sessionStateAddActionForWear(sessionState, + CUSTOM_ACTION_FAST_FORWARD, getString(R.string.fast_forward_label), android.R.drawable.ic_media_ff); + flavorHelper.mediaSessionSetExtraForWear(mediaSession); + } } sessionState.setActions(capabilities); - flavorHelper.sessionStateAddActionForWear(sessionState, - CUSTOM_ACTION_REWIND, getString(R.string.rewind_label), android.R.drawable.ic_media_rew); - flavorHelper.sessionStateAddActionForWear(sessionState, - CUSTOM_ACTION_FAST_FORWARD, getString(R.string.fast_forward_label), android.R.drawable.ic_media_ff); - - flavorHelper.mediaSessionSetExtraForWear(mediaSession); - mediaSession.setPlaybackState(sessionState.build()); }