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

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

Issue 2750973004: [Media>UI] Don't call onServiceStarted when handling a notification action (Closed)
Patch Set: added comments Created 3 years, 9 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 ce662d7e8b3e1ab9a5d1661c80bceb73acd5454a..01c791d7718515f67e5a2fa88122a78ac04111a4 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
@@ -190,9 +190,15 @@ public class MediaNotificationManager {
MediaNotificationManager manager = getManager();
if (manager == null || manager.mMediaNotificationInfo == null) return false;
- manager.onServiceStarted(this);
-
- processAction(intent, manager);
+ if (intent.getAction() == null) {
+ // The intent comes from {@link startService()} or
+ // {@link startServiceWithNotification}.
+ manager.onServiceStarted(this);
+ } else {
+ // The intent comes from the notification. In this case, {@link onServiceStarted()}
+ // does need to be called.
+ processAction(intent, manager);
+ }
return true;
}
@@ -616,6 +622,8 @@ public class MediaNotificationManager {
* @param service the service that was started
*/
private void onServiceStarted(ListenerService service) {
+ if (mService == service) return;
+
mService = service;
updateNotification();
}
« 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