summaryrefslogtreecommitdiff
path: root/core/src/play/java
diff options
context:
space:
mode:
authorAndrew Booze <42682253+awbooze@users.noreply.github.com>2023-02-24 10:10:44 -0600
committerGitHub <noreply@github.com>2023-02-24 17:10:44 +0100
commit59253db2e4ec8cced94541d97111429760c72a3d (patch)
treeb66674564e66878cda73b45cb0418525ae9e2e56 /core/src/play/java
parent7753c500dbfdd4e73fdb8517d3e740ee4b69a48c (diff)
downloadAntennaPod-59253db2e4ec8cced94541d97111429760c72a3d.zip
Add back skip buttons and more custom actions on Android Auto (#6050)
Diffstat (limited to 'core/src/play/java')
-rw-r--r--core/src/play/java/de/danoeh/antennapod/core/service/playback/WearMediaSession.java15
1 files changed, 7 insertions, 8 deletions
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);
}
}