Commit 47d6b3c2 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove <L compatibility code from NotificationWrapperBuilder.

The cancel button is a workaround for <L behavior and is a no-op in L+,
see docs for
androidx.media.app.NotificationCompat.MediaStyle#setShowCancelButton()

Bug: none
Change-Id: I7474644bcfdbf7bb4a24f6838b393756f174d1ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493482Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822835}
parent 713710ff
......@@ -754,8 +754,7 @@ public class MediaNotificationController {
// Only apply MediaStyle when NotificationInfo supports play/pause.
if (mMediaNotificationInfo.supportsPlayPause()) {
builder.setMediaStyle(mMediaSession, computeCompactViewActionIndices(bigViewActions),
createPendingIntent(ACTION_CANCEL), true);
builder.setMediaStyle(mMediaSession, computeCompactViewActionIndices(bigViewActions));
}
}
......
......@@ -104,8 +104,7 @@ public interface NotificationWrapperBuilder {
NotificationWrapperBuilder setStyle(Notification.BigTextStyle bigTextStyle);
NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions,
PendingIntent intent, boolean showCancelButton);
NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions);
NotificationWrapperBuilder setCategory(String category);
......
......@@ -255,14 +255,11 @@ public class NotificationWrapperCompatBuilder implements NotificationWrapperBuil
}
@Override
public NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions,
PendingIntent intent, boolean showCancelButton) {
public NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions) {
androidx.media.app.NotificationCompat.MediaStyle style =
new androidx.media.app.NotificationCompat.MediaStyle();
style.setMediaSession(session.getSessionToken());
style.setShowActionsInCompactView(actions);
style.setCancelButtonIntent(intent);
style.setShowCancelButton(showCancelButton);
mBuilder.setStyle(style);
return this;
}
......
......@@ -282,8 +282,7 @@ public class NotificationWrapperStandardBuilder implements NotificationWrapperBu
}
@Override
public NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions,
PendingIntent intent, boolean showCancelButton) {
public NotificationWrapperBuilder setMediaStyle(MediaSessionCompat session, int[] actions) {
Notification.MediaStyle style = new Notification.MediaStyle();
style.setMediaSession(((MediaSession) session.getMediaSession()).getSessionToken());
style.setShowActionsInCompactView(actions);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment