summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-05-07 22:39:38 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-07 22:39:38 +0000
commit6f73778357e6a338701846175c5cf8f0116729e5 (patch)
tree24fbc0953cdb4fc24aaaebbd9cf7aed246dac129 /InCallUI
parent27352bd8cca3ddf2866c1eba6bb02d50078d411d (diff)
parent58d7f084afd3d135c3bebeacf1b1a88d3e50fa0b (diff)
Merge changes I696bddf2,I4f62d509 into mnc-dev
* changes: Fix issue with misaligned glowpad handle Cache the non-rounded large bitmap instead of the rounded version
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/StatusBarNotifier.java23
-rw-r--r--InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java8
2 files changed, 21 insertions, 10 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index bc3687ced..a54536ce6 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);
}
/**
diff --git a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java
index 812e883c0..4bd27db9c 100644
--- a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java
+++ b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java
@@ -637,11 +637,15 @@ public class GlowPadView extends View {
}
/**
- * Sets teh handle drawable to the drawable specified by the resource ID.
+ * Sets the handle drawable to the drawable specified by the resource ID.
* @param resourceId
*/
public void setHandleDrawable(int resourceId) {
- mHandleDrawable = new TargetDrawable(getResources(), resourceId, 2);
+ if (mHandleDrawable != null) {
+ mHandleDrawable.setDrawable(getResources(), resourceId);
+ } else {
+ mHandleDrawable = new TargetDrawable(getResources(), resourceId, 1);
+ }
mHandleDrawable.setState(TargetDrawable.STATE_INACTIVE);
}