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
diff --git a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java
index 9b90ad5..9606b8e 100644
--- a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java
+++ b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java
@@ -83,18 +83,10 @@
   }
 
   @WorkerThread
-  private boolean isDirtyInternal(Context appContext) {
+  private boolean isDirtyInternal(Context appContext) throws Exception {
     ImmutableSet<DialerPhoneNumber> uniqueDialerPhoneNumbers =
         queryDistinctDialerPhoneNumbersFromAnnotatedCallLog(appContext);
-
-    try {
-      // TODO(zachh): Would be good to rework call log architecture to properly use futures.
-      // TODO(zachh): Consider how individual lookups should behave wrt timeouts/exceptions and
-      // handle appropriately here.
-      return phoneLookup.isDirty(uniqueDialerPhoneNumbers).get();
-    } catch (InterruptedException | ExecutionException e) {
-      throw new IllegalStateException(e);
-    }
+    return phoneLookup.isDirty(uniqueDialerPhoneNumbers).get();
   }
 
   /**
@@ -113,8 +105,9 @@
    *   <li>For inserts, uses the contents of PhoneLookupHistory to populate the fields of the
    *       provided mutations. (Note that at this point, data may not be fully up-to-date, but the
    *       next steps will take care of that.)
-   *   <li>Uses all of the numbers from AnnotatedCallLog to invoke CompositePhoneLookup:bulkUpdate
-   *   <li>Looks through the results of bulkUpdate
+   *   <li>Uses all of the numbers from AnnotatedCallLog to invoke (composite) {@link
+   *       PhoneLookup#getMostRecentPhoneLookupInfo(ImmutableMap)}
+   *   <li>Looks through the results of getMostRecentPhoneLookupInfo
    *       <ul>
    *         <li>For each number, checks if the original PhoneLookupInfo differs from the new one
    *         <li>If so, it applies the update to the mutations and (in onSuccessfulFill) writes the
@@ -142,7 +135,8 @@
 
     ImmutableMap<DialerPhoneNumber, PhoneLookupInfo> updatedInfoMap;
     try {
-      updatedInfoMap = phoneLookup.bulkUpdate(originalPhoneLookupInfosByNumber).get();
+      updatedInfoMap =
+          phoneLookup.getMostRecentPhoneLookupInfo(originalPhoneLookupInfosByNumber).get();
     } catch (InterruptedException | ExecutionException e) {
       throw new IllegalStateException(e);
     }
diff --git a/java/com/android/dialer/phonelookup/PhoneLookup.java b/java/com/android/dialer/phonelookup/PhoneLookup.java
index 1832775..eeab4da 100644
--- a/java/com/android/dialer/phonelookup/PhoneLookup.java
+++ b/java/com/android/dialer/phonelookup/PhoneLookup.java
@@ -27,8 +27,8 @@
  * 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 @@
   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 @@
    * <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 abc0c74..ee22446 100644
--- a/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java
+++ b/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java
@@ -97,12 +97,13 @@
    * 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 cd645a4..03e05b5 100644
--- a/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java
+++ b/java/com/android/dialer/phonelookup/cp2/Cp2PhoneLookup.java
@@ -188,8 +188,9 @@
   }
 
   @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));
   }