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
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index a0069a6..70fe88b 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -444,6 +444,7 @@
* activity is provided, it means that the activity was finished and we should attempt to cleanup.
*/
private void updateActivity(InCallActivity inCallActivity) {
+ Trace.beginSection("InCallPresenter.updateActivity");
boolean updateListeners = false;
boolean doAttemptCleanup = false;
@@ -475,6 +476,7 @@
if (mInCallState == InCallState.NO_CALLS) {
LogUtil.i("InCallPresenter.updateActivity", "UI Initialized, but no calls left. Shut down");
attemptFinishActivity();
+ Trace.endSection();
return;
}
} else {
@@ -510,6 +512,7 @@
if (doAttemptCleanup) {
attemptCleanup();
}
+ Trace.endSection();
}
public void setManageConferenceActivity(
@@ -842,7 +845,7 @@
if (!mCallList.hasLiveCall()
&& !call.getLogState().isIncoming
&& !isSecretCode(call.getNumber())
- && !CallerInfoUtils.isVoiceMailNumber(mContext, call)) {
+ && !call.isVoiceMailNumber()) {
PostCall.onCallDisconnected(mContext, call.getNumber(), call.getConnectTimeMillis());
}
}