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

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

Issue 1431023004: [Media, Android] Fix lockscreen and other remote controls on KK- (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle invalid intent. Remove an else. Created 5 years, 1 month 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
Index: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java
index f8f795b54ac65ddb4b748c4255d2a083495f6102..c18df6c25d139903619a3a436c22fae62d9c4bcd 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java
@@ -19,10 +19,14 @@ import java.util.List;
* to the service listening to them.
* This is there for backward compatibility with JB_MR0 and JB_MR1.
*/
-public class MediaButtonReceiver extends BroadcastReceiver {
+public abstract class MediaButtonReceiver extends BroadcastReceiver {
private static final String LISTENER_SERVICE_CLASS_NAME =
"org.chromium.chrome.browser.media.ui"
+ "MediaNotificationManager$ListenerService";
+ public static final String EXTRA_NOTIFICATION_ID =
+ "MediaNotificationManager.ListenerService.NOTIFICATION_ID";
+
+ public abstract int getNotificationId();
@Override
public void onReceive(Context context, Intent intent) {
@@ -39,6 +43,7 @@ public class MediaButtonReceiver extends BroadcastReceiver {
assert LISTENER_SERVICE_CLASS_NAME.equals(component.getClassName());
intent.setComponent(component);
+ intent.putExtra(EXTRA_NOTIFICATION_ID, getNotificationId());
context.startService(intent);
}
}

Powered by Google App Engine
This is Rietveld 408576698