From 9982f0db5e9b74a66d22befa113073c9cfcd221e Mon Sep 17 00:00:00 2001 From: wangqi Date: Wed, 11 Oct 2017 17:46:07 -0700 Subject: Optimization for incoming call latency. There are many binder call triggered by IPC on main thread. This change will try to reduce them by caching thing that's bound to a call. It reduce total binder transaction from 1002 to 664 and saves ~11% latency of incoming call on locked screen. 1. Cache isVoiceMailNumber in DialerCall 2. Cache call capable accounts in DialerCall 3. Cache current country iso in DialerCall 4. Don't set orientation change if it's not changed. This change also add lots of trace info. It won't affect release build though since they are stripped out by proguard. Bug: 64542087 Test: manual PiperOrigin-RevId: 171901266 Change-Id: Iec48f030529aa59974212147276f6d0ae121872a --- java/com/android/incallui/InCallActivityCommon.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/com/android/incallui/InCallActivityCommon.java') diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index 9ccda3251..0a7c2689b 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Bundle; +import android.os.Trace; import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -257,6 +258,7 @@ public class InCallActivityCommon { } public void onStart() { + Trace.beginSection("InCallActivityCommon.onStart"); // setting activity should be last thing in setup process InCallPresenter.getInstance().setActivity(inCallActivity); enableInCallOrientationEventListener( @@ -267,9 +269,11 @@ public class InCallActivityCommon { if (!isRecreating) { InCallPresenter.getInstance().onUiShowing(true); } + Trace.endSection(); } public void onResume() { + Trace.beginSection("InCallActivityCommon.onResume"); if (InCallPresenter.getInstance().isReadyForTearDown()) { LogUtil.i( "InCallActivityCommon.onResume", @@ -309,6 +313,7 @@ public class InCallActivityCommon { CallList.getInstance() .onInCallUiShown( inCallActivity.getIntent().getBooleanExtra(INTENT_EXTRA_FOR_FULL_SCREEN, false)); + Trace.endSection(); } // onPause is guaranteed to be called when the InCallActivity goes -- cgit v1.2.3