Search in sources :

Example 1 with CallDetailsEntry

use of com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry in project android_packages_apps_Dialer by LineageOS.

the class CallLogAdapter method generateAndMapNewCallDetailsEntriesHistoryResults.

private static CallDetailsEntries generateAndMapNewCallDetailsEntriesHistoryResults(@Nullable String number, @NonNull CallDetailsEntries callDetailsEntries, @NonNull Map<CallDetailsEntry, List<HistoryResult>> mappedResults) {
    if (number == null) {
        return callDetailsEntries;
    }
    CallDetailsEntries.Builder mutableCallDetailsEntries = CallDetailsEntries.newBuilder();
    for (CallDetailsEntry entry : callDetailsEntries.getEntriesList()) {
        CallDetailsEntry.Builder newEntry = CallDetailsEntry.newBuilder().mergeFrom(entry);
        List<HistoryResult> results = mappedResults.get(entry);
        if (results != null) {
            newEntry.addAllHistoryResults(mappedResults.get(entry));
            LogUtil.v("CallLogAdapter.generateAndMapNewCallDetailsEntriesHistoryResults", "mapped %d results", newEntry.getHistoryResultsList().size());
        }
        mutableCallDetailsEntries.addEntries(newEntry.build());
    }
    return mutableCallDetailsEntries.build();
}
Also used : HistoryResult(com.android.dialer.enrichedcall.historyquery.proto.HistoryResult) CallDetailsEntries(com.android.dialer.calldetails.CallDetailsEntries) CallDetailsEntry(com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry)

Aggregations

CallDetailsEntries (com.android.dialer.calldetails.CallDetailsEntries)1 CallDetailsEntry (com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry)1 HistoryResult (com.android.dialer.enrichedcall.historyquery.proto.HistoryResult)1