Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2044)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java

Issue 2279263002: Fix conflicting PendingIntent for stop button and swipe away (Closed)
Patch Set: split cancel button (pre-L) and swipe away Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
index 9afb25e538f20a6457746dfe874892120ba60f04..f8a916b16344542532dd852a10d8595a4b2fa5ca 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
@@ -63,6 +63,10 @@ public class MediaNotificationManager {
"MediaNotificationManager.ListenerService.PAUSE";
private static final String ACTION_STOP =
"MediaNotificationManager.ListenerService.STOP";
+ private static final String ACTION_SWIPE =
+ "MediaNotificationManager.ListenerService.SWIPE";
+ private static final String ACTION_CANCEL =
+ "MediaNotificationManager.ListenerService.CANCEL";
@Override
public IBinder onBind(Intent intent) {
@@ -134,7 +138,9 @@ public class MediaNotificationManager {
default:
break;
}
- } else if (ACTION_STOP.equals(action)) {
+ } else if (ACTION_STOP.equals(action)
+ || ACTION_SWIPE.equals(action)
+ || ACTION_CANCEL.equals(action)) {
manager.onStop(
MediaNotificationListener.ACTION_SOURCE_MEDIA_NOTIFICATION);
stopSelf();
@@ -517,7 +523,7 @@ public class MediaNotificationManager {
if (mMediaNotificationInfo.supportsSwipeAway()) {
mNotificationBuilder.setOngoing(!mMediaNotificationInfo.isPaused);
- mNotificationBuilder.setDeleteIntent(createPendingIntent(ListenerService.ACTION_STOP));
+ mNotificationBuilder.setDeleteIntent(createPendingIntent(ListenerService.ACTION_SWIPE));
}
// The intent will currently only be null when using a custom tab.
@@ -642,7 +648,7 @@ public class MediaNotificationManager {
createPendingIntent(ListenerService.ACTION_PAUSE));
}
style.setShowActionsInCompactView(0);
- style.setCancelButtonIntent(createPendingIntent(ListenerService.ACTION_STOP));
+ style.setCancelButtonIntent(createPendingIntent(ListenerService.ACTION_CANCEL));
style.setShowCancelButton(true);
builder.setStyle(style);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698