summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorChristine Chen <christinech@google.com>2013-09-30 15:14:08 -0700
committerChristine Chen <christinech@google.com>2013-09-30 15:14:08 -0700
commite464115c984ed0c7415c2103d6127f17b590e579 (patch)
tree49789b51d88779b3bb2804d569736e18e2d3e6f0 /InCallUI
parent9ea8fe6c56dfa08905953400c8940ff60a0c27ef (diff)
Scales the contact photo to fit notification icon
Bug: 11007879 Change-Id: Ide32f725bedc80095edd067ea531f0c07e18ffa3
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/StatusBarNotifier.java15
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;
}
/**