diff options
author | Nancy Chen <nancychen@google.com> | 2016-02-08 18:47:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-02-08 18:47:19 +0000 |
commit | 011d958b6d723cb49ea11671789a29114a6c1f86 (patch) | |
tree | b579e009e1b3ee41bbe4e2f2ed371b783258ec44 /InCallUI | |
parent | 89a85ba55e986a1223027a06d0dd474bb4176d67 (diff) | |
parent | c53600a348cd3fbea985e33310cf3c0957894c10 (diff) |
Merge "Fix NPE caused by misplaced parenthesis."
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 16 |
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 ea39aa646..1fd69423b 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) { CallList.getInstance().removeCallUpdateListener(previousPrimary.getId(), this); @@ -396,6 +394,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 |