diff options
author | Christine Chen <christinech@google.com> | 2013-10-01 02:47:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-01 02:47:33 +0000 |
commit | e5e9be3603f10f53fd72372da37e02926826b49e (patch) | |
tree | 61d83020e87c10963360249cd0d206d83ded4530 | |
parent | d61c93ec08aaaf09e0ee952454491b025b07e333 (diff) | |
parent | e464115c984ed0c7415c2103d6127f17b590e579 (diff) |
Merge "Scales the contact photo to fit notification icon" into klp-dev
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 89d074463..1690c5494 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -329,15 +329,24 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { * Gets a large icon from the contact info object to display in the notification. */ private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, boolean isConference) { + Bitmap largeIcon = null; if (isConference) { - return BitmapFactory.decodeResource(mContext.getResources(), + largeIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.picture_conference); } if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) { - return ((BitmapDrawable) contactInfo.photo).getBitmap(); + largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap(); } - return null; + 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 = Bitmap.createScaledBitmap(largeIcon, width, height, false); + } + + return largeIcon; } /** |