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

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

Issue 2814993005: [RemotePlayback] Use poster image as on lockscreen (Closed)
Patch Set: addressed nits Created 3 years, 8 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
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 659d14a023f88706f6ee0677b818c78027594c23..801e98f5e204e3d37e3616e04181492e48ec96e7 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
@@ -60,6 +60,8 @@ import javax.annotation.Nullable;
public class MediaNotificationManager {
private static final String TAG = "MediaNotification";
+ static final int MINIMAL_MEDIA_IMAGE_SIZE_PX = 114;
+
@VisibleForTesting
static final int CUSTOM_MEDIA_SESSION_ACTION_STOP = MediaSessionAction.LAST + 1;
@@ -540,6 +542,15 @@ public class MediaNotificationManager {
return HIGH_IMAGE_SIZE_PX;
}
+ /**
+ * @returns Whether |icon| is suitable as the media image, i.e. bigger than the minimal size.
+ * @param icon The icon to be checked.
+ */
+ public static boolean isBitmapSuitableAsMediaImage(Bitmap icon) {
+ return icon != null && icon.getWidth() >= MINIMAL_MEDIA_IMAGE_SIZE_PX
+ && icon.getHeight() >= MINIMAL_MEDIA_IMAGE_SIZE_PX;
+ }
+
private static MediaNotificationManager getManager(int notificationId) {
return sManagers.get(notificationId);
}

Powered by Google App Engine
This is Rietveld 408576698