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/ContactInfoCache.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'java/com/android/incallui/ContactInfoCache.java') diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java index 2a9394526..2fb18b8d7 100644 --- a/java/com/android/incallui/ContactInfoCache.java +++ b/java/com/android/incallui/ContactInfoCache.java @@ -807,10 +807,12 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { @Override public void onQueryComplete(int token, Object cookie, CallerInfo callerInfo) { + Trace.beginSection("ContactInfoCache.FindInfoCallback.onQueryComplete"); Assert.isMainThread(); DialerCallCookieWrapper cw = (DialerCallCookieWrapper) cookie; String callId = cw.callId; if (!isWaitingForThisQuery(cw.callId, mQueryToken.mQueryId)) { + Trace.endSection(); return; } ContactCacheEntry cacheEntry = mInfoMap.get(callId); @@ -818,6 +820,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { if (cacheEntry == null) { Log.w(TAG, "Contact lookup done, but cache entry is not found."); clearCallbacks(callId); + Trace.endSection(); return; } // Before issuing a request for more data from other services, we only check that the @@ -842,6 +845,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { } clearCallbacks(callId); } + Trace.endSection(); } } -- cgit v1.2.3