diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-18 01:33:48 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-18 01:33:48 +0000 |
commit | e1eafe662404ff434df35ac291396e7949f0aa23 (patch) | |
tree | da236df57418799ac9021de106da6b4a51e824d4 /java/com/android/dialer/shortcuts | |
parent | bd040bcf527504a34d0b58d0f009825fd5681c09 (diff) | |
parent | 60b2d299ac2808c8e51a202b3ba5bb946192d43e (diff) |
Merge changes Ia72bdfab,I72df9feb
* changes:
Update dynamic shortcuts to match speed dial pinned positions.
Add empty content view for when the user has no contacts in favorites.
Diffstat (limited to 'java/com/android/dialer/shortcuts')
-rw-r--r-- | java/com/android/dialer/shortcuts/ShortcutRefresher.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/java/com/android/dialer/shortcuts/ShortcutRefresher.java b/java/com/android/dialer/shortcuts/ShortcutRefresher.java index 3201d592d..7776aa9f0 100644 --- a/java/com/android/dialer/shortcuts/ShortcutRefresher.java +++ b/java/com/android/dialer/shortcuts/ShortcutRefresher.java @@ -25,6 +25,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.Worker; import com.android.dialer.common.concurrent.DialerExecutorComponent; +import com.android.dialer.speeddial.loader.SpeedDialUiItem; import java.util.ArrayList; import java.util.List; @@ -52,6 +53,20 @@ public final class ShortcutRefresher { .executeSerial(new ArrayList<>(contacts)); } + public static List<ContactEntry> speedDialUiItemsToContactEntries(List<SpeedDialUiItem> items) { + List<ContactEntry> contactEntries = new ArrayList<>(); + for (SpeedDialUiItem item : items) { + ContactEntry entry = new ContactEntry(); + entry.id = item.contactId(); + entry.lookupKey = item.lookupKey(); + // SpeedDialUiItem name's are already configured for alternative display orders, so we don't + // need to account for them in these entries. + entry.namePrimary = item.name(); + contactEntries.add(entry); + } + return contactEntries; + } + private static final class RefreshWorker implements Worker<List<ContactEntry>, Void> { private final Context context; |