From 4a5339c4a266891ce560dfb6e348c3779a0a3ca1 Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Thu, 29 Aug 2013 13:55:27 -0700 Subject: Fix null precondition check. Precondition was making sure call was not null. But the call could be null in cases where the call disconnected before the UI comes up. In this case, we can simply skip processing. Bug: 10538437 Change-Id: Ia4ff093f38cdc32bdaf6325d9dc770b302d0060b --- .../src/com/android/incallui/CallCardPresenter.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index c06806926..d7386167b 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -70,18 +70,23 @@ public class CallCardPresenter extends Presenter public void init(Context context, PhoneNumberService phoneNumberService, Call call) { mContext = Preconditions.checkNotNull(context); mPhoneNumberService = Preconditions.checkNotNull(phoneNumberService); - Preconditions.checkNotNull(call); mContext = context; mPhoneNumberService = phoneNumberService; - final CallIdentification identification = call.getIdentification(); - // TODO(klp): Logic to determine which ui field get what data resides in contactInfoCache. - // It needs to be moved so it can be re-used. - mPrimaryContactInfo = ContactInfoCache.buildCacheEntryFromCall(mContext, identification, - call.getState() == Call.State.INCOMING); + // Call may be null if disconnect happened already. + if (call != null) { + final CallIdentification identification = call.getIdentification(); - // start processing lookups right away. - startContactInfoSearch(identification, true, false, call.getState() == Call.State.INCOMING); + // TODO(klp): Logic to determine which ui field get what data resides in + // contactInfoCache. + // It needs to be moved so it can be re-used. + mPrimaryContactInfo = ContactInfoCache.buildCacheEntryFromCall(mContext, identification, + call.getState() == Call.State.INCOMING); + + // start processing lookups right away. + startContactInfoSearch(identification, true, false, + call.getState() == Call.State.INCOMING); + } } @Override -- cgit v1.2.3