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/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index 70fe88b..1ba3b5d 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -273,7 +273,9 @@
public static synchronized InCallPresenter getInstance() {
if (sInCallPresenter == null) {
+ Trace.beginSection("InCallPresenter.Constructor");
sInCallPresenter = new InCallPresenter();
+ Trace.endSection();
}
return sInCallPresenter;
}
@@ -1033,7 +1035,7 @@
// We need to update the notification bar when we leave the UI because that
// could trigger it to show again.
if (mStatusBarNotifier != null) {
- mStatusBarNotifier.updateNotification(mCallList);
+ mStatusBarNotifier.updateNotification();
}
if (mProximitySensor != null) {
@@ -1088,10 +1090,6 @@
void onActivityStarted() {
LogUtil.d("InCallPresenter.onActivityStarted", "onActivityStarted");
notifyVideoPauseController(true);
- if (mStatusBarNotifier != null) {
- // TODO(maxwelb) - b/36649622: Investigate this redundant call
- mStatusBarNotifier.updateNotification(mCallList);
- }
applyScreenTimeout();
}
@@ -1385,7 +1383,7 @@
} else if (startIncomingCallSequence) {
LogUtil.i("InCallPresenter.startOrFinishUi", "Start Full Screen in call UI");
- mStatusBarNotifier.updateNotification(mCallList);
+ mStatusBarNotifier.updateNotification();
} else if (newState == InCallState.NO_CALLS) {
// The new state is the no calls state. Tear everything down.
attemptFinishActivity();