summaryrefslogtreecommitdiffstats
path: root/java/com/android/incallui/CallerInfoAsyncQuery.java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-10-11 17:46:07 -0700
committerEric Erfanian <erfanian@google.com>2017-10-12 14:30:51 -0700
commit9982f0db5e9b74a66d22befa113073c9cfcd221e (patch)
treeb5307eb2e3ebbd1ac616441f3c562babcdbd84db /java/com/android/incallui/CallerInfoAsyncQuery.java
parent2cec38000c225d15a7b895db28541f4be2f2df7b (diff)
downloadandroid_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/CallerInfoAsyncQuery.java')
-rw-r--r--java/com/android/incallui/CallerInfoAsyncQuery.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/com/android/incallui/CallerInfoAsyncQuery.java b/java/com/android/incallui/CallerInfoAsyncQuery.java
index 09752c71f..8fc9c4f14 100644
--- a/java/com/android/incallui/CallerInfoAsyncQuery.java
+++ b/java/com/android/incallui/CallerInfoAsyncQuery.java
@@ -29,6 +29,7 @@ import android.os.Build.VERSION_CODES;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
+import android.os.Trace;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Directory;
import android.support.annotation.MainThread;
@@ -191,9 +192,11 @@ public class CallerInfoAsyncQuery {
CallerInfo info,
OnQueryCompleteListener listener,
Object cookie) {
+ Trace.beginSection("CallerInfoAsyncQuery.startOtherDirectoriesQuery");
long[] directoryIds = StrictModeUtils.bypass(() -> getDirectoryIds(context));
int size = directoryIds.length;
if (size == 0) {
+ Trace.endSection();
return false;
}
@@ -213,6 +216,7 @@ public class CallerInfoAsyncQuery {
OnQueryCompleteListener intermediateListener = listenerFactory.newListener(directoryId);
startQueryInternal(token, context, info, intermediateListener, cookie, uri);
}
+ Trace.endSection();
return true;
}