diff options
author | wangqi <wangqi@google.com> | 2017-10-11 17:46:07 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-12 14:30:51 -0700 |
commit | 9982f0db5e9b74a66d22befa113073c9cfcd221e (patch) | |
tree | b5307eb2e3ebbd1ac616441f3c562babcdbd84db /java/com/android/incallui/InCallActivity.java | |
parent | 2cec38000c225d15a7b895db28541f4be2f2df7b (diff) | |
download | android_packages_apps_Dialer-9982f0db5e9b74a66d22befa113073c9cfcd221e.tar.gz android_packages_apps_Dialer-9982f0db5e9b74a66d22befa113073c9cfcd221e.tar.bz2 android_packages_apps_Dialer-9982f0db5e9b74a66d22befa113073c9cfcd221e.zip |
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
Diffstat (limited to 'java/com/android/incallui/InCallActivity.java')
-rw-r--r-- | java/com/android/incallui/InCallActivity.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 2ba4d98a1..2e3d721df 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -95,6 +95,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity private boolean touchDownWhenPseudoScreenOff; private boolean isInShowMainInCallFragment; private boolean needDismissPendingDialogs; + private boolean allowOrientationChange; public InCallActivity() { common = new InCallActivityCommon(this); @@ -161,7 +162,9 @@ public class InCallActivity extends TransactionSafeFragmentActivity protected void onStart() { Trace.beginSection("InCallActivity.onStart"); LogUtil.i("InCallActivity.onStart", ""); + Trace.beginSection("call super"); super.onStart(); + Trace.endSection(); isVisible = true; showMainInCallFragment(); common.onStart(); @@ -514,6 +517,10 @@ public class InCallActivity extends TransactionSafeFragmentActivity } public void setAllowOrientationChange(boolean allowOrientationChange) { + if (this.allowOrientationChange == allowOrientationChange) { + return; + } + this.allowOrientationChange = allowOrientationChange; if (!allowOrientationChange) { setRequestedOrientation(InCallOrientationEventListener.ACTIVITY_PREFERENCE_DISALLOW_ROTATION); } else { |