Search in sources :

Example 1 with Builder

use of com.android.dialer.phonelookup.PhoneLookupInfo.Builder in project android_packages_apps_Dialer by LineageOS.

the class CompositePhoneLookup method combineSubMessageFutures.

/**
 * Combines a list of sub-message futures into a future for {@link PhoneLookupInfo}.
 */
@SuppressWarnings({ "unchecked", "rawtype" })
private ListenableFuture<PhoneLookupInfo> combineSubMessageFutures(List<ListenableFuture<?>> subMessageFutures) {
    return Futures.transform(Futures.allAsList(subMessageFutures), subMessages -> {
        Preconditions.checkNotNull(subMessages);
        Builder mergedInfo = PhoneLookupInfo.newBuilder();
        for (int i = 0; i < subMessages.size(); i++) {
            PhoneLookup phoneLookup = phoneLookups.get(i);
            phoneLookup.setSubMessage(mergedInfo, subMessages.get(i));
        }
        return mergedInfo.build();
    }, lightweightExecutorService);
}
Also used : Builder(com.android.dialer.phonelookup.PhoneLookupInfo.Builder) PhoneLookup(com.android.dialer.phonelookup.PhoneLookup)

Aggregations

PhoneLookup (com.android.dialer.phonelookup.PhoneLookup)1 Builder (com.android.dialer.phonelookup.PhoneLookupInfo.Builder)1