summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorChiao Cheng <chiaocheng@google.com>2013-08-29 23:32:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-29 23:32:44 +0000
commit7569427c703ae89003317ee3e37dfa9e171d8abe (patch)
treebf488bd2c9df7110d81c953f5ce51885d9ea0d75 /InCallUI
parent55b990cc582b77cc7f778ee7459e750e35de2d67 (diff)
parent4a5339c4a266891ce560dfb6e348c3779a0a3ca1 (diff)
Merge "Fix null precondition check." into klp-dev
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 71bc60287..5cb4219d4 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<CallCardPresenter.CallCardUi>
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