From c8cf79e8e834148ff37759f59e83e169584ee99f Mon Sep 17 00:00:00 2001 From: wangqi Date: Tue, 17 Oct 2017 09:21:00 -0700 Subject: Some cleanup of incoming call latency. 1. Only update secondary info when it's changed. 2. Removed redundant call to update notification on activity start (b/36649622) 3. Use same call back for notification update from contact info query to avoid duplicated call backs. The actual latency reduction is insignificant (<10%). Bug: 36649622,64542087 Test: manual PiperOrigin-RevId: 172475223 Change-Id: I1c91cb5715287991de774a1d9b95e4c8b722d28f --- java/com/android/incallui/CallCardPresenter.java | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'java/com/android/incallui/CallCardPresenter.java') diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 871243c7d..0ef0c9827 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -319,17 +319,19 @@ public class CallCardPresenter previousPrimary.removeListener(this); } - if (mSecondary == null) { - // Secondary call may have ended. Update the ui. - mSecondaryContactInfo = null; - updateSecondaryDisplayInfo(); - } else if (secondaryChanged) { - // secondary call has changed - mSecondaryContactInfo = - ContactInfoCache.buildCacheEntryFromCall( - mContext, mSecondary, mSecondary.getState() == DialerCall.State.INCOMING); - updateSecondaryDisplayInfo(); - maybeStartSearch(mSecondary, false); + if (secondaryChanged) { + if (mSecondary == null) { + // Secondary call may have ended. Update the ui. + mSecondaryContactInfo = null; + updateSecondaryDisplayInfo(); + } else { + // secondary call has changed + mSecondaryContactInfo = + ContactInfoCache.buildCacheEntryFromCall( + mContext, mSecondary, mSecondary.getState() == DialerCall.State.INCOMING); + updateSecondaryDisplayInfo(); + maybeStartSearch(mSecondary, false); + } } // Set the call state -- cgit v1.2.3