diff options
author | Yorke Lee <yorkelee@google.com> | 2014-08-28 13:28:09 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-08-28 13:28:09 -0700 |
commit | 8ecbbb5ec14c797fdc3834f3c7d30a0e14edcaf9 (patch) | |
tree | 146f13f86deb717e38666ead9cc791d47e153cb6 | |
parent | f0ab8dae956d9887a6582870c29f274b0157b4eb (diff) |
Fix possible NPEs in CallCardPresenter
It is possible for mSecondaryContactInfo and mSecondaryCall to
be out of sync due to the contact cache callback happening after
a change in call state.
If such a case happens, ignore the updated contact info change since
the call has been destroyed and nulled out.
Bug: 17309877
Change-Id: I70d8f7ca77e6b4971cf9335b00170bbdb7cf7fcd
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index c37aaec73..1335766b0 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -469,7 +469,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } final boolean isGenericConf = isGenericConference(mPrimary); - if (entry != null) { + if (entry != null && mPrimary != null) { final String name = getNameForCall(entry); final String number = getNumberForCall(entry); final boolean nameIsNumber = name != null && name.equals(entry.number); @@ -482,14 +482,13 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private void updateSecondaryDisplayInfo(boolean isConference) { - final CallCardUi ui = getUi(); if (ui == null) { return; } final boolean isGenericConf = isGenericConference(mSecondary); - if (mSecondaryContactInfo != null) { + if (mSecondaryContactInfo != null && mSecondary != null) { Log.d(TAG, "updateSecondaryDisplayInfo() " + mSecondaryContactInfo); final String nameForCall = getNameForCall(mSecondaryContactInfo); |