summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/ui
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-01-29 13:45:58 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-29 15:36:05 -0800
commit75a8d5170399b37d33bced7825a9f6d88a5ec233 (patch)
tree35a7e6ae0b6dbdae5ba84388a55853af78ac875f /java/com/android/dialer/calllog/ui
parentadd7d143419d8ada612eb3e0bb2807b0e97dff35 (diff)
Added is_valid and post_dial_portion fields to DialerPhoneNumber.
These are frequently used attributes of numbers that we can compute once at parse-time. Also did some general cleanup of DialerPhoneNumberUtil: -Removed unused Future version of parse() -Remove formatToValidE164 now that the new fields are available -Inlined normalizeNumber() Bug: 72563861 Test: existing PiperOrigin-RevId: 183720128 Change-Id: I702dc265360e590439c5352c493ae8a858f36812
Diffstat (limited to 'java/com/android/dialer/calllog/ui')
-rw-r--r--java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java b/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java
index f15c3136c..421c35f55 100644
--- a/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java
+++ b/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java
@@ -36,13 +36,11 @@ import com.android.dialer.phonelookup.PhoneLookupInfo;
import com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator;
import com.android.dialer.phonelookup.database.contract.PhoneLookupHistoryContract;
import com.android.dialer.phonelookup.database.contract.PhoneLookupHistoryContract.PhoneLookupHistory;
-import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.i18n.phonenumbers.PhoneNumberUtil;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -151,9 +149,6 @@ public final class RealtimeRowProcessor {
ListenableFuture<Integer> applyBatchFuture =
backgroundExecutor.submit(
() -> {
- DialerPhoneNumberUtil dialerPhoneNumberUtil =
- new DialerPhoneNumberUtil(PhoneNumberUtil.getInstance());
-
ArrayList<ContentProviderOperation> operations = new ArrayList<>();
long currentTimestamp = System.currentTimeMillis();
for (Entry<DialerPhoneNumber, PhoneLookupInfo> entry : currentBatch.entrySet()) {
@@ -162,7 +157,8 @@ public final class RealtimeRowProcessor {
// Note: Multiple DialerPhoneNumbers can map to the same normalized number but we
// just write them all and the value for the last one will arbitrarily win.
- String normalizedNumber = dialerPhoneNumberUtil.normalizeNumber(dialerPhoneNumber);
+ // Note: This loses country info when number is not valid.
+ String normalizedNumber = dialerPhoneNumber.getNormalizedNumber();
ContentValues contentValues = new ContentValues();
contentValues.put(