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
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index 871243c..0ef0c98 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -319,17 +319,19 @@
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