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

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

Issue 1948123004: [Media, UI] Improve large icon in MediaNotification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/MediaSessionTabHelper.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/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 5fb9cf708edafbe8cde94164986a2d4fc5086bd0..b2233db03f9f78aac9d0747d30bdae4d99337399 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
@@ -48,11 +48,6 @@ import javax.annotation.Nullable;
public class MediaNotificationManager {
private static final String TAG = "MediaNotification";
- // The background notification size on Android Wear. See:
- // http://developer.android.com/training/wearables/notifications/creating.html
- private static final int WEARABLE_NOTIFICATION_BACKGROUND_WIDTH = 400;
- private static final int WEARABLE_NOTIFICATION_BACKGROUND_HEIGHT = 400;
-
// We're always used on the UI thread but the LOCK is required by lint when creating the
// singleton.
private static final Object LOCK = new Object();
@@ -500,11 +495,6 @@ public class MediaNotificationManager {
metadataBuilder.putString(MediaMetadataCompat.METADATA_KEY_ARTIST,
mMediaNotificationInfo.origin);
}
- if (mMediaNotificationInfo.largeIcon != null) {
- metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART,
- scaleBitmapForWearable(mMediaNotificationInfo.largeIcon));
- }
-
if (!TextUtils.isEmpty(mMediaNotificationInfo.metadata.getArtist())) {
metadataBuilder.putString(MediaMetadataCompat.METADATA_KEY_ARTIST,
mMediaNotificationInfo.metadata.getArtist());
@@ -726,21 +716,6 @@ public class MediaNotificationManager {
return contentView;
}
- /**
- * Scales the Bitmap to make the notification background on Wearable devices look better.
- * The returned Bitmap size will be exactly 400x400.
- * According to http://developer.android.com/training/wearables/notifications/creating.html,
- * the background image of Android Wear notifications should be of size 400x400 or 640x400.
- * Otherwise, it will be scaled to fit the desired size. However for some reason (maybe battery
- * concern), the smoothing filter is not applied when scaling the image, so we need to manually
- * scale the image with filter applied before sending to Android Wear.
- */
- private Bitmap scaleBitmapForWearable(Bitmap original) {
- Bitmap result = Bitmap.createScaledBitmap(original, WEARABLE_NOTIFICATION_BACKGROUND_WIDTH,
- WEARABLE_NOTIFICATION_BACKGROUND_HEIGHT, true);
- return result;
- }
-
private Bitmap drawableToBitmap(Drawable drawable) {
if (!(drawable instanceof BitmapDrawable)) return null;
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698