diff --git a/libraries/session/src/main/java/androidx/media3/session/PlayerNotificationManager.java b/libraries/session/src/main/java/androidx/media3/session/PlayerNotificationManager.java index 3f9bfc91b1..cbaf7acf25 100644 --- a/libraries/session/src/main/java/androidx/media3/session/PlayerNotificationManager.java +++ b/libraries/session/src/main/java/androidx/media3/session/PlayerNotificationManager.java @@ -134,11 +134,6 @@ import java.util.Map; *
  • Corresponding setter: {@link #setUseNextActionInCompactView(boolean)} *
  • Default: {@code false} * - *
  • {@code useStopAction} - Sets whether the stop action is used. - * * * *

    Overriding drawables

    @@ -156,7 +151,6 @@ import java.util.Map; *
  • {@code exo_notification_fastforward} - The fast forward icon. *
  • {@code exo_notification_previous} - The previous icon. *
  • {@code exo_notification_next} - The next icon. - *
  • {@code exo_notification_stop} - The stop icon. * * *

    Alternatively, the action icons can be set programatically by using the {@link Builder}. @@ -320,7 +314,6 @@ public class PlayerNotificationManager { protected int rewindActionIconResourceId; protected int playActionIconResourceId; protected int pauseActionIconResourceId; - protected int stopActionIconResourceId; protected int fastForwardActionIconResourceId; protected int previousActionIconResourceId; protected int nextActionIconResourceId; @@ -357,7 +350,6 @@ public class PlayerNotificationManager { smallIconResourceId = R.drawable.exo_notification_small_icon; playActionIconResourceId = R.drawable.exo_notification_play; pauseActionIconResourceId = R.drawable.exo_notification_pause; - stopActionIconResourceId = R.drawable.exo_notification_stop; rewindActionIconResourceId = R.drawable.exo_notification_rewind; fastForwardActionIconResourceId = R.drawable.exo_notification_fastforward; previousActionIconResourceId = R.drawable.exo_notification_previous; @@ -467,18 +459,6 @@ public class PlayerNotificationManager { return this; } - /** - * The resource id of the drawable to be used as the icon of action {@link #ACTION_STOP}. - * - *

    The default is {@code R.drawable#exo_notification_stop}. - * - * @return This builder. - */ - public Builder setStopActionIconResourceId(int stopActionIconResourceId) { - this.stopActionIconResourceId = stopActionIconResourceId; - return this; - } - /** * The resource id of the drawable to be used as the icon of action {@link #ACTION_REWIND}. * @@ -573,7 +553,6 @@ public class PlayerNotificationManager { smallIconResourceId, playActionIconResourceId, pauseActionIconResourceId, - stopActionIconResourceId, rewindActionIconResourceId, fastForwardActionIconResourceId, previousActionIconResourceId, @@ -615,8 +594,6 @@ public class PlayerNotificationManager { public static final String ACTION_FAST_FORWARD = "androidx.media3.ui.notification.ffwd"; /** The action which rewinds. */ public static final String ACTION_REWIND = "androidx.media3.ui.notification.rewind"; - /** The action which stops playback. */ - public static final String ACTION_STOP = "androidx.media3.ui.notification.stop"; /** The extra key of the instance id of the player notification manager. */ public static final String EXTRA_INSTANCE_ID = "INSTANCE_ID"; /** @@ -694,7 +671,6 @@ public class PlayerNotificationManager { private boolean useRewindActionInCompactView; private boolean useFastForwardActionInCompactView; private boolean usePlayPauseActions; - private boolean useStopAction; private int badgeIconType; private boolean colorized; private int defaults; @@ -715,7 +691,6 @@ public class PlayerNotificationManager { int smallIconResourceId, int playActionIconResourceId, int pauseActionIconResourceId, - int stopActionIconResourceId, int rewindActionIconResourceId, int fastForwardActionIconResourceId, int previousActionIconResourceId, @@ -761,7 +736,6 @@ public class PlayerNotificationManager { instanceId, playActionIconResourceId, pauseActionIconResourceId, - stopActionIconResourceId, rewindActionIconResourceId, fastForwardActionIconResourceId, previousActionIconResourceId, @@ -953,19 +927,6 @@ public class PlayerNotificationManager { } } - /** - * Sets whether the stop action should be used. - * - * @param useStopAction Whether to use the stop action. - */ - public final void setUseStopAction(boolean useStopAction) { - if (this.useStopAction == useStopAction) { - return; - } - this.useStopAction = useStopAction; - invalidate(); - } - /** * Sets the {@link MediaSessionCompat.Token}. * @@ -1293,9 +1254,9 @@ public class PlayerNotificationManager { * omitted: * *

    -   *   +------------------------------------------------------------------------+
    -   *   | prev | << | play/pause | >> | next | custom actions | stop |
    -   *   +------------------------------------------------------------------------+
    +   *   +-----------------------------------------------------------------+
    +   *   | prev | << | play/pause | >> | next | custom actions |
    +   *   +-----------------------------------------------------------------+
        * 
    * *

    This method can be safely overridden. However, the names must be of the playback actions @@ -1333,9 +1294,6 @@ public class PlayerNotificationManager { if (customActionReceiver != null) { stringActions.addAll(customActionReceiver.getCustomActions(player)); } - if (useStopAction) { - stringActions.add(ACTION_STOP); - } return stringActions; } @@ -1427,7 +1385,6 @@ public class PlayerNotificationManager { int instanceId, int playActionIconResourceId, int pauseActionIconResourceId, - int stopActionIconResourceId, int rewindActionIconResourceId, int fastForwardActionIconResourceId, int previousActionIconResourceId, @@ -1445,12 +1402,6 @@ public class PlayerNotificationManager { pauseActionIconResourceId, context.getString(R.string.exo_controls_pause_description), createBroadcastIntent(ACTION_PAUSE, context, instanceId))); - actions.put( - ACTION_STOP, - new NotificationCompat.Action( - stopActionIconResourceId, - context.getString(R.string.exo_controls_stop_description), - createBroadcastIntent(ACTION_STOP, context, instanceId))); actions.put( ACTION_REWIND, new NotificationCompat.Action( @@ -1546,8 +1497,6 @@ public class PlayerNotificationManager { player.seekForward(); } else if (ACTION_NEXT.equals(action)) { player.seekToNext(); - } else if (ACTION_STOP.equals(action)) { - player.stop(/* reset= */ true); } else if (ACTION_DISMISS.equals(action)) { stopNotification(/* dismissedByUser= */ true); } else if (action != null diff --git a/libraries/session/src/main/res/drawable/exo_icon_stop.xml b/libraries/session/src/main/res/drawable/exo_icon_stop.xml deleted file mode 100644 index fc788c7bfe..0000000000 --- a/libraries/session/src/main/res/drawable/exo_icon_stop.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/libraries/session/src/main/res/values/drawables.xml b/libraries/session/src/main/res/values/drawables.xml index ef4402dd0c..cf9fd833c1 100644 --- a/libraries/session/src/main/res/values/drawables.xml +++ b/libraries/session/src/main/res/values/drawables.xml @@ -20,6 +20,5 @@ @drawable/exo_icon_previous @drawable/exo_icon_fastforward @drawable/exo_icon_rewind - @drawable/exo_icon_stop @drawable/exo_icon_circular_play diff --git a/libraries/session/src/main/res/values/strings.xml b/libraries/session/src/main/res/values/strings.xml index 3d20979d1d..bfe64d4bdc 100644 --- a/libraries/session/src/main/res/values/strings.xml +++ b/libraries/session/src/main/res/values/strings.xml @@ -36,10 +36,8 @@ Pause Play - - Stop Rewind Fast forward - \ No newline at end of file +