From 9779f967ebb9512e5b19090b071572c9c4f0f2a6 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 27 Mar 2017 12:31:48 -0700 Subject: Update AOSP Dialer source from internal google3 repository at cl/151342913. Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/151128062 (3/24/2017) to cl/151342913 (3/27/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: I8d4855628b62e9067e71f32ed40317617a1e3b02 --- .../android/dialer/app/calllog/CallLogAdapter.java | 19 ++++++++++-- .../dialer/app/calllog/CallLogAsyncTaskUtil.java | 4 +-- .../dialer/app/contactinfo/ContactInfoCache.java | 34 ++++++++++++---------- .../android/dialer/app/res/values-ne/strings.xml | 2 +- .../android/dialer/app/res/values-uz/strings.xml | 4 +-- .../app/voicemail/VoicemailPlaybackPresenter.java | 4 +-- 6 files changed, 41 insertions(+), 26 deletions(-) (limited to 'java/com/android/dialer/app') diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index b23e18d6b..301fc009e 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -58,9 +58,9 @@ import com.android.dialer.calldetails.nano.CallDetailsEntries.CallDetailsEntry; import com.android.dialer.calllogutils.PhoneAccountUtils; import com.android.dialer.calllogutils.PhoneCallDetails; import com.android.dialer.common.Assert; -import com.android.dialer.common.AsyncTaskExecutor; -import com.android.dialer.common.AsyncTaskExecutors; import com.android.dialer.common.LogUtil; +import com.android.dialer.common.concurrent.AsyncTaskExecutor; +import com.android.dialer.common.concurrent.AsyncTaskExecutors; import com.android.dialer.enrichedcall.EnrichedCallCapabilities; import com.android.dialer.enrichedcall.EnrichedCallComponent; import com.android.dialer.enrichedcall.EnrichedCallManager; @@ -457,6 +457,7 @@ public class CallLogAdapter extends GroupingListAdapter final long rowId, final PhoneCallDetails details, final CallDetailsEntries callDetailsEntries) { + LogUtil.d("CallLogAdapter.loadAndRender", "position: %d", views.getAdapterPosition()); // Reset block and spam information since this view could be reused which may contain // outdated data. views.isSpam = false; @@ -667,12 +668,13 @@ public class CallLogAdapter extends GroupingListAdapter && !isVoicemailNumber) { // Lookup contacts with this number // Only do remote lookup in first 5 rows. + int position = views.getAdapterPosition(); info = mContactInfoCache.getValue( details.number + details.postDialDigits, details.countryIso, details.cachedContactInfo, - rowId + position < Bindings.get(mActivity) .getConfigProvider() .getLong("number_of_call_to_do_remote_lookup", 5L)); @@ -699,6 +701,17 @@ public class CallLogAdapter extends GroupingListAdapter details.objectId = info.objectId; details.contactUserType = info.userType; } + LogUtil.d( + "CallLogAdapter.loadData", + "position:%d, update geo info: %s, cequint caller id geo: %s, photo uri: %s <- %s", + views.getAdapterPosition(), + details.geocode, + info.geoDescription, + details.photoUri, + info.photoUri); + if (!TextUtils.isEmpty(info.geoDescription)) { + details.geocode = info.geoDescription; + } views.info = info; views.numberType = diff --git a/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java b/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java index 2198626d6..2aedb6f17 100644 --- a/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java +++ b/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java @@ -28,8 +28,8 @@ import android.provider.VoicemailContract.Voicemails; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; -import com.android.dialer.common.AsyncTaskExecutor; -import com.android.dialer.common.AsyncTaskExecutors; +import com.android.dialer.common.concurrent.AsyncTaskExecutor; +import com.android.dialer.common.concurrent.AsyncTaskExecutors; import com.android.dialer.util.PermissionsUtil; import com.android.voicemail.VoicemailClient; diff --git a/java/com/android/dialer/app/contactinfo/ContactInfoCache.java b/java/com/android/dialer/app/contactinfo/ContactInfoCache.java index 6c35711a8..ab5541b6f 100644 --- a/java/com/android/dialer/app/contactinfo/ContactInfoCache.java +++ b/java/com/android/dialer/app/contactinfo/ContactInfoCache.java @@ -18,9 +18,11 @@ package com.android.dialer.app.contactinfo; import android.os.Handler; import android.os.Message; +import android.os.SystemClock; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import android.text.TextUtils; +import com.android.dialer.common.LogUtil; import com.android.dialer.phonenumbercache.ContactInfo; import com.android.dialer.phonenumbercache.ContactInfoHelper; import com.android.dialer.util.ExpirableCache; @@ -97,39 +99,29 @@ public class ContactInfoCache { NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso); ExpirableCache.CachedValue cachedInfo = mCache.getCachedValue(numberCountryIso); ContactInfo info = cachedInfo == null ? null : cachedInfo.getValue(); + int requestType = + remoteLookupIfNotFoundLocally + ? ContactInfoRequest.TYPE_LOCAL_AND_REMOTE + : ContactInfoRequest.TYPE_LOCAL; if (cachedInfo == null) { mCache.put(numberCountryIso, ContactInfo.EMPTY); // Use the cached contact info from the call log. info = callLogContactInfo; // The db request should happen on a non-UI thread. // Request the contact details immediately since they are currently missing. - int requestType = - remoteLookupIfNotFoundLocally - ? ContactInfoRequest.TYPE_LOCAL_AND_REMOTE - : ContactInfoRequest.TYPE_LOCAL; enqueueRequest(number, countryIso, callLogContactInfo, /* immediate */ true, requestType); // We will format the phone number when we make the background request. } else { if (cachedInfo.isExpired()) { // The contact info is no longer up to date, we should request it. However, we // do not need to request them immediately. - enqueueRequest( - number, - countryIso, - callLogContactInfo, /* immediate */ - false, - ContactInfoRequest.TYPE_LOCAL); + enqueueRequest(number, countryIso, callLogContactInfo, /* immediate */ false, requestType); } else if (!callLogInfoMatches(callLogContactInfo, info)) { // The call log information does not match the one we have, look it up again. // We could simply update the call log directly, but that needs to be done in a // background thread, so it is easier to simply request a new lookup, which will, as // a side-effect, update the call log. - enqueueRequest( - number, - countryIso, - callLogContactInfo, /* immediate */ - false, - ContactInfoRequest.TYPE_LOCAL); + enqueueRequest(number, countryIso, callLogContactInfo, /* immediate */ false, requestType); } if (info == ContactInfo.EMPTY) { @@ -152,9 +144,19 @@ public class ContactInfoCache { * to update its content. */ private boolean queryContactInfo(ContactInfoRequest request) { + LogUtil.d( + "ContactInfoCache.queryContactInfo", + "request number: %s, type: %d", + LogUtil.sanitizePhoneNumber(request.number), + request.type); ContactInfo info; if (request.isLocalRequest()) { info = mContactInfoHelper.lookupNumber(request.number, request.countryIso); + // TODO: Maybe skip look up if it's already available in cached number lookup service. + long start = SystemClock.uptimeMillis(); + mContactInfoHelper.updateFromCequintCallerId(info, request.number); + long time = SystemClock.uptimeMillis() - start; + LogUtil.d("ContactInfoCache.queryContactInfo", "Cequint Caller Id look up takes %d ms", time); if (request.type == ContactInfoRequest.TYPE_LOCAL_AND_REMOTE) { if (!mContactInfoHelper.hasName(info)) { enqueueRequest( diff --git a/java/com/android/dialer/app/res/values-ne/strings.xml b/java/com/android/dialer/app/res/values-ne/strings.xml index 29eaccdb5..33989648e 100644 --- a/java/com/android/dialer/app/res/values-ne/strings.xml +++ b/java/com/android/dialer/app/res/values-ne/strings.xml @@ -193,7 +193,7 @@ "कल रोक्दै" "भ्वाइस मेल" "कल अवरुद्ध अस्थायी रुपमा निष्क्रिय" - "कल अवरुद्ध अस्थायी रुपमा असक्षम गरिएको छ किनभने तपाईँले अन्तिम ४८ घण्टा भित्र यस फोनबाट आपत्कालीन सेवाहरू सम्पर्क गर्नुभयो। एकपटक ४८ घण्टा अवधि समाप्त भएपछि यो स्वचालित रूपले पुनः सक्रिय हुनेछ।" + "कल अवरुद्ध अस्थायी रुपमा असक्षम गरिएको छ किनभने तपाईँले अन्तिम ४८ घन्टा भित्र यस फोनबाट आपत्कालीन सेवाहरू सम्पर्क गर्नुभयो। एकपटक ४८ घन्टा अवधि समाप्त भएपछि यो स्वचालित रूपले पुनः सक्रिय हुनेछ।" "नम्बरहरू आयात गर्नुहोस्" "तपाईँले पहिल्यै केही कल गर्ने व्यक्तिहरूलाई अन्य अनुप्रयोगहरू मार्फत स्वत: रूपमा भ्वाइस मेल पठाउन नै चिन्ह लगाउनु भएको थियो।" "नम्बरहरू हेर्नुहोस्" diff --git a/java/com/android/dialer/app/res/values-uz/strings.xml b/java/com/android/dialer/app/res/values-uz/strings.xml index d26c53cf4..11befbc51 100644 --- a/java/com/android/dialer/app/res/values-uz/strings.xml +++ b/java/com/android/dialer/app/res/values-uz/strings.xml @@ -40,7 +40,7 @@ "Javobsiz chaqiruvlar" "%d ta javobsiz chaqiruv" "Telefon" - "SMS yuborish" + "SMS yozish" "%1$s: %2$s" %1$d ta ovozli xabar @@ -143,7 +143,7 @@ "Barcha raqamlarni ko‘rish uchun rasm ustiga bosing yoki joyini o‘zgartirish uchun rasmni bosib turing." "O‘chirish" "Video qo‘ng‘iroq" - "SMS yuborish" + "Xabar yuborish" "Chaqiruv tafsilotlari" "Yuborish:" "Qo‘ng‘iroq qilish: ^1" diff --git a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java index 994160ff9..492f2088b 100644 --- a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java +++ b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java @@ -46,10 +46,10 @@ import com.android.common.io.MoreCloseables; import com.android.dialer.app.R; import com.android.dialer.app.calllog.CallLogListItemViewHolder; import com.android.dialer.common.Assert; -import com.android.dialer.common.AsyncTaskExecutor; -import com.android.dialer.common.AsyncTaskExecutors; import com.android.dialer.common.ConfigProviderBindings; import com.android.dialer.common.LogUtil; +import com.android.dialer.common.concurrent.AsyncTaskExecutor; +import com.android.dialer.common.concurrent.AsyncTaskExecutors; import com.android.dialer.constants.Constants; import com.android.dialer.logging.Logger; import com.android.dialer.logging.nano.DialerImpression; -- cgit v1.2.3