diff options
author | Christine Chen <christinech@google.com> | 2013-10-02 09:34:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-02 09:34:16 -0700 |
commit | 5f469eb7ca41aafebc2256d7175923e8a7fe5759 (patch) | |
tree | 0b1cf0f4613474889608fc6a13ffd60c86b4ecab | |
parent | 6a117ffc663a690d87815ddc86988a6d7c0a4897 (diff) | |
parent | c7fdc36c593e4cbeb643b380169c86430437fc49 (diff) |
am 6965268e: am 678cdf0c: Merge "Scales the contact photo to fit notification icon" into klp-dev
* commit '6965268ec95569f64f096181c43ba2b2343cc7f1':
Scales the contact photo to fit notification icon
-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; } /** |