summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2016-04-28 15:52:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-28 15:52:50 +0000
commit3e9c2b933a4f90419fed2b2f6aceee5c1303f6c4 (patch)
tree45d4f197e50c8f5fe927408bef5f7123334dda15 /InCallUI
parente022778ac4e419cd42f15b69c3fa3a9b8bedc35c (diff)
parent36a1cc6c86f8e3658c8b45bfacb8f7ad07221912 (diff)
Merge "[DO NOT MERGE] Fix NPE caused by misplaced parenthesis." into nyc-dev
am: 36a1cc6 * commit '36a1cc6c86f8e3658c8b45bfacb8f7ad07221912': [DO NOT MERGE] Fix NPE caused by misplaced parenthesis. Change-Id: I3e595a732f56311be3d717b0f52c8fdf3b017e61
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 3e3926ba9..d0762fdd0 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