summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/phonelookup
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2017-12-06 19:25:22 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-07 18:29:54 -0800
commitd28981d41c3691fc9fa5204e1d02fa4f2d818b43 (patch)
tree16b231f84897cd8c1047dbfed4bd7ee702a11e7b /java/com/android/dialer/phonelookup
parent0c0c0a318d72e4b6f24514c4c6b3a173e249297d (diff)
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
Diffstat (limited to 'java/com/android/dialer/phonelookup')
-rw-r--r--java/com/android/dialer/phonelookup/PhoneLookup.java20
-rw-r--r--java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java7
-rw-r--r--java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java5
3 files changed, 17 insertions, 15 deletions
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.
*
* <p>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<Boolean> isDirty(ImmutableSet<DialerPhoneNumber> 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.
*
* <p>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 {
* <p>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<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>> bulkUpdate(
+ ListenableFuture<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>> getMostRecentPhoneLookupInfo(
ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> 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.
*
* <p>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<Void> 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<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>> bulkUpdate(
- ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> existingInfoMap) {
+ public ListenableFuture<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>>
+ getMostRecentPhoneLookupInfo(
+ ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> existingInfoMap) {
List<ListenableFuture<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>>> 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<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>> bulkUpdate(
- ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> existingInfoMap) {
+ public ListenableFuture<ImmutableMap<DialerPhoneNumber, PhoneLookupInfo>>
+ getMostRecentPhoneLookupInfo(
+ ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> existingInfoMap) {
return backgroundExecutorService.submit(() -> bulkUpdateInternal(existingInfoMap));
}