summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/CallCardPresenter.java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-10-17 09:21:00 -0700
committerEric Erfanian <erfanian@google.com>2017-10-17 13:42:04 -0700
commitc8cf79e8e834148ff37759f59e83e169584ee99f (patch)
tree8cb92a8b0af7dc9d3278a5e1389f1cc646c26b98 /java/com/android/incallui/CallCardPresenter.java
parent0d1362b28afb4a71b8b2a56bad2be3fcf2802de6 (diff)
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
Diffstat (limited to 'java/com/android/incallui/CallCardPresenter.java')
-rw-r--r--java/com/android/incallui/CallCardPresenter.java24
1 files changed, 13 insertions, 11 deletions
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