From 73ae7522a6d9faca76f24b94e3bb3e2088e5f74f Mon Sep 17 00:00:00 2001 From: twyen Date: Fri, 16 Mar 2018 12:40:07 -0700 Subject: Use current county ISO for PhoneLookupHistoryRecorder Previously it is unclear what the "county ISO" should be so the originating county of the SIM is used. When telecom writes to the call log the county the user is in is used. This caused the DialerPhoneNumber key in in call UI and call log to differ and info to be lost. In this CL, the current country is used in PhoneLookupHistoryRecorder to make it consistent with the call log. PhoneLookupHistoryRecorder is currently the only consumer for telecom call util.getCountryCode(). Additionally, dialer/location no longer depends on dialer/util. dialer/util has too many unnecessary dependencies that will cause cycles. Bug: 73752730 Test: Unit tests PiperOrigin-RevId: 189378542 Change-Id: I59773f7745c835a6523efda951c475e2fde9aaf9 --- java/com/android/incallui/PhoneLookupHistoryRecorder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/com/android/incallui') diff --git a/java/com/android/incallui/PhoneLookupHistoryRecorder.java b/java/com/android/incallui/PhoneLookupHistoryRecorder.java index 802bf63cb..16d73ced9 100644 --- a/java/com/android/incallui/PhoneLookupHistoryRecorder.java +++ b/java/com/android/incallui/PhoneLookupHistoryRecorder.java @@ -24,6 +24,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.configprovider.ConfigProviderBindings; +import com.android.dialer.location.GeoUtil; import com.android.dialer.phonelookup.PhoneLookupComponent; import com.android.dialer.phonelookup.PhoneLookupInfo; import com.android.dialer.phonelookup.database.contract.PhoneLookupHistoryContract.PhoneLookupHistory; @@ -61,8 +62,7 @@ final class PhoneLookupHistoryRecorder { DialerPhoneNumberUtil dialerPhoneNumberUtil = new DialerPhoneNumberUtil(PhoneNumberUtil.getInstance()); return dialerPhoneNumberUtil.parse( - TelecomCallUtil.getNumber(call), - TelecomCallUtil.getCountryCode(appContext, call).orNull()); + TelecomCallUtil.getNumber(call), GeoUtil.getCurrentCountryIso(appContext)); }); ListenableFuture infoFuture = -- cgit v1.2.3