diff options
author | wangqi <wangqi@google.com> | 2017-10-17 09:21:00 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-17 13:42:04 -0700 |
commit | c8cf79e8e834148ff37759f59e83e169584ee99f (patch) | |
tree | 8cb92a8b0af7dc9d3278a5e1389f1cc646c26b98 /java/com/android/incallui/InCallPresenter.java | |
parent | 0d1362b28afb4a71b8b2a56bad2be3fcf2802de6 (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/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 10 |
1 files changed, 4 insertions, 6 deletions
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(); |