diff options
Diffstat (limited to 'java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java')
-rw-r--r-- | java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java b/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java index 4be43dade..365b21883 100644 --- a/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java +++ b/java/com/android/dialer/phonelookup/composite/CompositePhoneLookup.java @@ -230,6 +230,17 @@ public final class CompositePhoneLookup { } } + /** Delegates to sub-lookups' {@link PhoneLookup#clearData()}. */ + public ListenableFuture<Void> clearData() { + List<ListenableFuture<Void>> futures = new ArrayList<>(); + for (PhoneLookup<?> phoneLookup : phoneLookups) { + ListenableFuture<Void> phoneLookupFuture = phoneLookup.clearData(); + futures.add(phoneLookupFuture); + } + return Futures.transform( + Futures.allAsList(futures), unused -> null, lightweightExecutorService); + } + private static String getMostRecentInfoEventName(Object classNameSource, boolean isBuilt) { return String.format( !isBuilt |