From 59253db2e4ec8cced94541d97111429760c72a3d Mon Sep 17 00:00:00 2001 From: Andrew Booze <42682253+awbooze@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:10:44 -0600 Subject: Add back skip buttons and more custom actions on Android Auto (#6050) --- .../core/service/playback/WearMediaSession.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core/src/play/java') diff --git a/core/src/play/java/de/danoeh/antennapod/core/service/playback/WearMediaSession.java b/core/src/play/java/de/danoeh/antennapod/core/service/playback/WearMediaSession.java index 8df05d10d..47881da0b 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/service/playback/WearMediaSession.java +++ b/core/src/play/java/de/danoeh/antennapod/core/service/playback/WearMediaSession.java @@ -6,21 +6,20 @@ import android.support.v4.media.session.PlaybackStateCompat; import android.support.wearable.media.MediaControlConstants; public class WearMediaSession { - static void sessionStateAddActionForWear(PlaybackStateCompat.Builder sessionState, String actionName, - CharSequence name, int icon) { - PlaybackStateCompat.CustomAction.Builder actionBuilder = - new PlaybackStateCompat.CustomAction.Builder(actionName, name, icon); + /** + * Take a custom action builder and make sure the custom action shows on Wear OS because this is the Play version + * of the app. + */ + static void addWearExtrasToAction(PlaybackStateCompat.CustomAction.Builder actionBuilder) { Bundle actionExtras = new Bundle(); actionExtras.putBoolean(MediaControlConstants.EXTRA_CUSTOM_ACTION_SHOW_ON_WEAR, true); actionBuilder.setExtras(actionExtras); - - sessionState.addCustomAction(actionBuilder.build()); } static void mediaSessionSetExtraForWear(MediaSessionCompat mediaSession) { Bundle sessionExtras = new Bundle(); - sessionExtras.putBoolean(MediaControlConstants.EXTRA_RESERVE_SLOT_SKIP_TO_PREVIOUS, true); - sessionExtras.putBoolean(MediaControlConstants.EXTRA_RESERVE_SLOT_SKIP_TO_NEXT, true); + sessionExtras.putBoolean(MediaControlConstants.EXTRA_RESERVE_SLOT_SKIP_TO_PREVIOUS, false); + sessionExtras.putBoolean(MediaControlConstants.EXTRA_RESERVE_SLOT_SKIP_TO_NEXT, false); mediaSession.setExtras(sessionExtras); } } -- cgit v1.2.3