merge in nyc-release history after reset to nyc-dev
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index d0762fd..3e3926b 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -249,6 +249,7 @@
Call.areSameNumber(mPrimary, primary));
final boolean secondaryChanged = !(Call.areSame(mSecondary, secondary) &&
Call.areSameNumber(mSecondary, secondary));
+ final boolean shouldShowCallSubject = shouldShowCallSubject(mPrimary);
mSecondary = secondary;
Call previousPrimary = mPrimary;
@@ -261,8 +262,9 @@
// Refresh primary call information if either:
// 1. Primary call changed.
// 2. The call's ability to manage conference has changed.
- // 3. The call subject should be shown or hidden.
- if (shouldRefreshPrimaryInfo(primaryChanged, ui, shouldShowCallSubject(mPrimary))) {
+ if (mPrimary != null && (primaryChanged ||
+ ui.isManageConferenceVisible() != shouldShowManageConference()) ||
+ ui.isCallSubjectVisible() != shouldShowCallSubject) {
// primary call has changed
if (previousPrimary != null) {
//clear progess spinner (if any) related to previous primary call
@@ -400,16 +402,6 @@
updatePrimaryDisplayInfo();
}
- private boolean shouldRefreshPrimaryInfo(boolean primaryChanged, CallCardUi ui,
- boolean shouldShowCallSubject) {
- if (mPrimary == null) {
- return false;
- }
- return primaryChanged ||
- ui.isManageConferenceVisible() != shouldShowManageConference() ||
- ui.isCallSubjectVisible() != shouldShowCallSubject;
- }
-
private String getSubscriptionNumber() {
// If it's an emergency call, and they're not populating the callback number,
// then try to fall back to the phone sub info (to hopefully get the SIM's
diff --git a/src/com/android/dialer/calllog/CallTypeIconsView.java b/src/com/android/dialer/calllog/CallTypeIconsView.java
index 1474843..cfd8f97 100644
--- a/src/com/android/dialer/calllog/CallTypeIconsView.java
+++ b/src/com/android/dialer/calllog/CallTypeIconsView.java
@@ -42,20 +42,17 @@
public class CallTypeIconsView extends View {
private List<Integer> mCallTypes = Lists.newArrayListWithCapacity(3);
private boolean mShowVideo = false;
+ private Resources mResources;
private int mWidth;
private int mHeight;
- private static Resources sResources;
-
public CallTypeIconsView(Context context) {
this(context, null);
}
public CallTypeIconsView(Context context, AttributeSet attrs) {
super(context, attrs);
- if (sResources == null) {
- sResources = new Resources(context);
- }
+ mResources = new Resources(context);
}
public void clear() {
@@ -69,7 +66,7 @@
mCallTypes.add(callType);
final Drawable drawable = getCallTypeDrawable(callType);
- mWidth += drawable.getIntrinsicWidth() + sResources.iconMargin;
+ mWidth += drawable.getIntrinsicWidth() + mResources.iconMargin;
mHeight = Math.max(mHeight, drawable.getIntrinsicHeight());
invalidate();
}
@@ -82,8 +79,8 @@
public void setShowVideo(boolean showVideo) {
mShowVideo = showVideo;
if (showVideo) {
- mWidth += sResources.videoCall.getIntrinsicWidth();
- mHeight = Math.max(mHeight, sResources.videoCall.getIntrinsicHeight());
+ mWidth += mResources.videoCall.getIntrinsicWidth();
+ mHeight = Math.max(mHeight, mResources.videoCall.getIntrinsicHeight());
invalidate();
}
}
@@ -110,21 +107,21 @@
private Drawable getCallTypeDrawable(int callType) {
switch (callType) {
case AppCompatConstants.CALLS_INCOMING_TYPE:
- return sResources.incoming;
+ return mResources.incoming;
case AppCompatConstants.CALLS_OUTGOING_TYPE:
- return sResources.outgoing;
+ return mResources.outgoing;
case AppCompatConstants.CALLS_MISSED_TYPE:
- return sResources.missed;
+ return mResources.missed;
case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
- return sResources.voicemail;
+ return mResources.voicemail;
case AppCompatConstants.CALLS_BLOCKED_TYPE:
- return sResources.blocked;
+ return mResources.blocked;
default:
// It is possible for users to end up with calls with unknown call types in their
// call history, possibly due to 3rd party call log implementations (e.g. to
// distinguish between rejected and missed calls). Instead of crashing, just
// assume that all unknown call types are missed calls.
- return sResources.missed;
+ return mResources.missed;
}
}
@@ -141,14 +138,14 @@
final int right = left + drawable.getIntrinsicWidth();
drawable.setBounds(left, 0, right, drawable.getIntrinsicHeight());
drawable.draw(canvas);
- left = right + sResources.iconMargin;
+ left = right + mResources.iconMargin;
}
// If showing the video call icon, draw it scaled appropriately.
if (mShowVideo) {
- final Drawable drawable = sResources.videoCall;
- final int right = left + sResources.videoCall.getIntrinsicWidth();
- drawable.setBounds(left, 0, right, sResources.videoCall.getIntrinsicHeight());
+ final Drawable drawable = mResources.videoCall;
+ final int right = left + mResources.videoCall.getIntrinsicWidth();
+ drawable.setBounds(left, 0, right, mResources.videoCall.getIntrinsicHeight());
drawable.draw(canvas);
}
}