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/InCallPresenter.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'java/com/android/incallui/InCallPresenter.java') diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index 70fe88be8..1ba3b5d3a 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -273,7 +273,9 @@ public class InCallPresenter implements CallList.Listener { public static synchronized InCallPresenter getInstance() { if (sInCallPresenter == null) { + Trace.beginSection("InCallPresenter.Constructor"); sInCallPresenter = new InCallPresenter(); + Trace.endSection(); } return sInCallPresenter; } @@ -1033,7 +1035,7 @@ public class InCallPresenter implements CallList.Listener { // 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 @@ public class InCallPresenter implements CallList.Listener { 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 @@ public class InCallPresenter implements CallList.Listener { } 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(); -- cgit v1.2.3