diff options
author | Yorke Lee <yorkelee@google.com> | 2015-05-07 23:00:02 +0000 |
---|---|---|
committer | Android Partner Code Review <android-gerrit-partner@google.com> | 2015-05-07 23:00:02 +0000 |
commit | 54587783b58b50b395bc6a24a6992698acf6bd21 (patch) | |
tree | 2a66ec46ebb2b38378e7925fb124555c0d9154c1 /InCallUI | |
parent | c1ccffba5d0e533d1e837851393e10356ed4bc91 (diff) | |
parent | 4c711526bfcd94b99dc486765073123d0a7a5636 (diff) |
Merge "DO NOT MERGE Cache the non-rounded large bitmap instead of the rounded version" into m-wireless-dev
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 1dd8a6cc5..d46444be0 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -197,7 +197,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, // Check if data has changed; if nothing is different, don't issue another notification. final int iconResId = getIconToDisplay(call); - final Bitmap largeIcon = getLargeIconToDisplay(contactInfo, call); + Bitmap largeIcon = getLargeIconToDisplay(contactInfo, call); final int contentResId = getContentString(call); final String contentTitle = getContentTitle(contactInfo, call); @@ -205,6 +205,10 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, return; } + if (largeIcon != null) { + largeIcon = getRoundedIcon(largeIcon); + } + /* * Nothing more to check...build and send it. */ @@ -352,15 +356,18 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) { largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap(); } + return largeIcon; + } - if (largeIcon != null) { - final int height = (int) mContext.getResources().getDimension( - android.R.dimen.notification_large_icon_height); - final int width = (int) mContext.getResources().getDimension( - android.R.dimen.notification_large_icon_width); - largeIcon = BitmapUtil.getRoundedBitmap(largeIcon, width, height); + private Bitmap getRoundedIcon(Bitmap bitmap) { + if (bitmap == null) { + return null; } - return largeIcon; + final int height = (int) mContext.getResources().getDimension( + android.R.dimen.notification_large_icon_height); + final int width = (int) mContext.getResources().getDimension( + android.R.dimen.notification_large_icon_width); + return BitmapUtil.getRoundedBitmap(bitmap, width, height); } /** |