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/dialer/location/GeoUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/location') diff --git a/java/com/android/dialer/location/GeoUtil.java b/java/com/android/dialer/location/GeoUtil.java index b39256d32..27fbf2315 100644 --- a/java/com/android/dialer/location/GeoUtil.java +++ b/java/com/android/dialer/location/GeoUtil.java @@ -17,6 +17,7 @@ package com.android.dialer.location; import android.content.Context; +import android.os.Trace; /** Static methods related to Geo. */ public class GeoUtil { @@ -24,6 +25,9 @@ public class GeoUtil { /** @return the ISO 3166-1 two letters country code of the country the user is in. */ public static String getCurrentCountryIso(Context context) { // The {@link CountryDetector} should never return null so this is safe to return as-is. - return CountryDetector.getInstance(context).getCurrentCountryIso(); + Trace.beginSection("GeoUtil.getCurrentCountryIso"); + String countryIso = CountryDetector.getInstance(context).getCurrentCountryIso(); + Trace.endSection(); + return countryIso; } } -- cgit v1.2.3