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 a83e0f314b87724a7d4bf8f4b308e0871d9bb403..5cfed32bba2c70b3c9f85a0046e5c1ea9d6777d2 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 |
@@ -408,7 +408,8 @@ public class MediaNotificationManager { |
/** |
* Shows the notification with media controls with the specified media info. Replaces/updates |
* the current notification if already showing. Does nothing if |mediaNotificationInfo| hasn't |
- * changed from the last one. |
+ * changed from the last one. If |mediaNotificationInfo.isPaused| is true and the tabId |
+ * mismatches |mMediaNotificationInfo.isPaused|, it is also no-op. |
* |
* @param applicationContext context to create the notification with |
* @param notificationInfo information to show in the notification |
@@ -654,6 +655,10 @@ public class MediaNotificationManager { |
private void showNotification(MediaNotificationInfo mediaNotificationInfo) { |
if (mediaNotificationInfo.equals(mMediaNotificationInfo)) return; |
+ if (mediaNotificationInfo.isPaused && mMediaNotificationInfo != null |
+ && mediaNotificationInfo.tabId != mMediaNotificationInfo.tabId) { |
+ return; |
+ } |
mMediaNotificationInfo = mediaNotificationInfo; |
mContext.startService(createIntent(mContext)); |