Search in sources :

Example 6 with PartitionedNumbers

use of com.android.dialer.phonenumberproto.PartitionedNumbers in project android_packages_apps_Dialer by LineageOS.

the class Cp2DefaultDirectoryPhoneLookup method findUnprocessableNumbers.

private ArraySet<DialerPhoneNumber> findUnprocessableNumbers(ImmutableMap<DialerPhoneNumber, Cp2Info> existingInfoMap) {
    ArraySet<DialerPhoneNumber> unprocessableNumbers = new ArraySet<>();
    PartitionedNumbers partitionedNumbers = new PartitionedNumbers(existingInfoMap.keySet());
    int invalidNumberCount = partitionedNumbers.invalidNumbers().size();
    Logger.get(appContext).logAnnotatedCallLogMetrics(invalidNumberCount);
    if (invalidNumberCount > getMaxSupportedInvalidNumbers()) {
        for (String invalidNumber : partitionedNumbers.invalidNumbers()) {
            unprocessableNumbers.addAll(partitionedNumbers.dialerPhoneNumbersForInvalid(invalidNumber));
        }
    }
    return unprocessableNumbers;
}
Also used : PartitionedNumbers(com.android.dialer.phonenumberproto.PartitionedNumbers) ArraySet(android.support.v4.util.ArraySet) DialerPhoneNumber(com.android.dialer.DialerPhoneNumber)

Aggregations

PartitionedNumbers (com.android.dialer.phonenumberproto.PartitionedNumbers)6 ArraySet (android.support.v4.util.ArraySet)5 DialerPhoneNumber (com.android.dialer.DialerPhoneNumber)4 Cursor (android.database.Cursor)3 Cp2ContactInfo (com.android.dialer.phonelookup.PhoneLookupInfo.Cp2Info.Cp2ContactInfo)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 ArrayList (java.util.ArrayList)3 ArrayMap (android.support.v4.util.ArrayMap)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 List (java.util.List)2 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 Set (java.util.Set)2 Context (android.content.Context)1 SharedPreferences (android.content.SharedPreferences)1 Uri (android.net.Uri)1 ContactsContract (android.provider.ContactsContract)1 Phone (android.provider.ContactsContract.CommonDataKinds.Phone)1 Contacts (android.provider.ContactsContract.Contacts)1