From d28981d41c3691fc9fa5204e1d02fa4f2d818b43 Mon Sep 17 00:00:00 2001 From: zachh Date: Wed, 6 Dec 2017 19:25:22 -0800 Subject: Renamed PhoneLookup#bulkUpdate to #getMostRecentPhoneLookupInfo. This is just to more clearly convey what the method does. Bug: 34672501 Test: existing PiperOrigin-RevId: 178188575 Change-Id: Id02f34b1d79346ecd8ca9eebc043fe9b3063264b --- java/com/android/dialer/phonelookup/PhoneLookup.java | 20 ++++++++++---------- .../phonelookup/composite/CompositePhoneLookup.java | 7 ++++--- .../dialer/phonelookup/cp2/Cp2PhoneLookup.java | 5 +++-- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'java/com/android/dialer/phonelookup') diff --git a/java/com/android/dialer/phonelookup/PhoneLookup.java b/java/com/android/dialer/phonelookup/PhoneLookup.java index 183277569..eeab4dadd 100644 --- a/java/com/android/dialer/phonelookup/PhoneLookup.java +++ b/java/com/android/dialer/phonelookup/PhoneLookup.java @@ -27,8 +27,8 @@ import com.google.common.util.concurrent.ListenableFuture; * Provides operations related to retrieving information about phone numbers. * *

Some operations defined by this interface are generally targeted towards specific use cases; - * for example {@link #isDirty(ImmutableSet)}, {@link #bulkUpdate(ImmutableMap)}, and {@link - * #onSuccessfulBulkUpdate()} are generally intended to be used by the call log. + * for example {@link #isDirty(ImmutableSet)}, {@link #getMostRecentPhoneLookupInfo(ImmutableMap)}, + * and {@link #onSuccessfulBulkUpdate()} are generally intended to be used by the call log. */ public interface PhoneLookup { @@ -48,9 +48,9 @@ public interface PhoneLookup { ListenableFuture isDirty(ImmutableSet phoneNumbers); /** - * Performs a bulk update of this {@link PhoneLookup}. The returned map must contain the exact - * same keys as the provided map. Most implementations will rely on last modified timestamps to - * efficiently only update the data which needs to be updated. + * Get the most recent phone lookup information for this {@link PhoneLookup}. The returned map + * must contain the exact same keys as the provided map. Most implementations will rely on last + * modified timestamps to efficiently only update the data which needs to be updated. * *

If there are no changes required, it is valid for this method to simply return the provided * {@code existingInfoMap}. @@ -58,16 +58,16 @@ public interface PhoneLookup { *

If there is no longer information associated with a number (for example, a local contact was * deleted) the returned map should contain an empty {@link PhoneLookupInfo} for that number. */ - ListenableFuture> bulkUpdate( + ListenableFuture> getMostRecentPhoneLookupInfo( ImmutableMap existingInfoMap); /** - * Called when the results of the {@link #bulkUpdate(ImmutableMap)} have been applied by the - * caller. + * Called when the results of the {@link #getMostRecentPhoneLookupInfo(ImmutableMap)} have been + * applied by the caller. * *

Typically implementations will use this to store a "last processed" timestamp so that future - * invocations of {@link #isDirty(ImmutableSet)} and {@link #bulkUpdate(ImmutableMap)} can be - * efficiently implemented. + * invocations of {@link #isDirty(ImmutableSet)} and {@link + * #getMostRecentPhoneLookupInfo(ImmutableMap)} can be efficiently implemented. */ ListenableFuture onSuccessfulBulkUpdate(); } diff --git a/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java b/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java index abc0c74fd..ee2244615 100644 --- a/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java +++ b/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java @@ -97,12 +97,13 @@ public final class CompositePhoneLookup implements PhoneLookup { * the dependent lookups does not complete, the returned future will also not complete. */ @Override - public ListenableFuture> bulkUpdate( - ImmutableMap existingInfoMap) { + public ListenableFuture> + getMostRecentPhoneLookupInfo( + ImmutableMap existingInfoMap) { List>> futures = new ArrayList<>(); for (PhoneLookup phoneLookup : phoneLookups) { - futures.add(phoneLookup.bulkUpdate(existingInfoMap)); + futures.add(phoneLookup.getMostRecentPhoneLookupInfo(existingInfoMap)); } return Futures.transform( Futures.allAsList(futures), diff --git a/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java b/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java index cd645a447..03e05b563 100644 --- a/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java +++ b/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java @@ -188,8 +188,9 @@ public final class Cp2PhoneLookup implements PhoneLookup { } @Override - public ListenableFuture> bulkUpdate( - ImmutableMap existingInfoMap) { + public ListenableFuture> + getMostRecentPhoneLookupInfo( + ImmutableMap existingInfoMap) { return backgroundExecutorService.submit(() -> bulkUpdateInternal(existingInfoMap)); } -- cgit v1.2.3