summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/CallCardPresenter.java
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 3e3926ba9..a7d4dd483 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -249,7 +249,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
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;
@@ -262,9 +261,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
// Refresh primary call information if either:
// 1. Primary call changed.
// 2. The call's ability to manage conference has changed.
- if (mPrimary != null && (primaryChanged ||
- ui.isManageConferenceVisible() != shouldShowManageConference()) ||
- ui.isCallSubjectVisible() != shouldShowCallSubject) {
+ // 3. The call subject should be shown or hidden.
+ if (shouldRefreshPrimaryInfo(primaryChanged, ui, shouldShowCallSubject(mPrimary))) {
// primary call has changed
if (previousPrimary != null) {
//clear progess spinner (if any) related to previous primary call
@@ -402,6 +400,16 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
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
@@ -450,6 +458,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
getUi().showHdAudioIndicator(showHdAudioIndicator);
}
+ private void maybeShowSpamIconAndLabel() {
+ getUi().showSpamIndicator(mPrimary.isSpam());
+ }
+
/**
* Only show the conference call button if we can manage the conference.
*/
@@ -818,6 +830,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
boolean isEmergencyCall = mPrimary.isEmergencyCall();
mEmergencyCallListener.onCallUpdated((BaseFragment) ui, isEmergencyCall);
}
+ maybeShowSpamIconAndLabel();
}
private void updateSecondaryDisplayInfo() {
@@ -1155,6 +1168,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
void setProgressSpinnerVisible(boolean visible);
void showHdAudioIndicator(boolean visible);
void showForwardIndicator(boolean visible);
+ void showSpamIndicator(boolean visible);
void showManageConferenceCallButton(boolean visible);
boolean isManageConferenceVisible();
boolean isCallSubjectVisible();