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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java » ('j') | 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/remote/CastNotificationControl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java
index 96b6acee46549ffc9a6ce37d5307012b26453d12..7c562fa5e51caa9808a114d307217fc3cd4102eb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java
@@ -83,6 +83,8 @@ public class CastNotificationControl implements MediaRouteController.UiListener,
}
mPosterBitmap = posterBitmap;
if (mNotificationBuilder == null || mMediaRouteController == null) return;
+
+ updateNotificationBuilderIfPosterIsGoodEnough();
mNotificationBuilder.setNotificationLargeIcon(mMediaRouteController.getPoster());
updateNotification();
}
@@ -108,10 +110,11 @@ public class CastNotificationControl implements MediaRouteController.UiListener,
.setPrivate(false)
.setNotificationSmallIcon(R.drawable.ic_notification_media_route)
.setContentIntent(contentIntent)
- .setNotificationLargeIcon(mMediaRouteController.getPoster())
.setDefaultNotificationLargeIcon(R.drawable.cast_playing_square)
.setId(R.id.remote_notification)
.setListener(this);
+
+ updateNotificationBuilderIfPosterIsGoodEnough();
mState = initialState;
updateNotification();
mIsShowing = true;
@@ -145,7 +148,7 @@ public class CastNotificationControl implements MediaRouteController.UiListener,
// poster changes.
public void onPosterBitmapChanged() {
if (mNotificationBuilder == null || mMediaRouteController == null) return;
- mNotificationBuilder.setNotificationLargeIcon(mMediaRouteController.getPoster());
+ updateNotificationBuilderIfPosterIsGoodEnough();
updateNotification();
}
@@ -235,4 +238,12 @@ public class CastNotificationControl implements MediaRouteController.UiListener,
boolean isShowingForTests() {
return mIsShowing;
}
+
+ private void updateNotificationBuilderIfPosterIsGoodEnough() {
+ Bitmap poster = mMediaRouteController.getPoster();
+ if (MediaNotificationManager.isBitmapSuitableAsMediaImage(poster)) {
+ mNotificationBuilder.setNotificationLargeIcon(poster);
+ mNotificationBuilder.setMediaSessionImage(poster);
+ }
+ }
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698