Improve Hybird hotseat cache support

Loads list of cached apps and shows predicted app icons with the rest of workspace items.

-> Extracted prediction caching logic into a model layer

Bug: 155029837
Test: Manual

Change-Id: I6981594a910f5fe4e8e8cf8fe39db0cb856e7acd
This commit is contained in:
Samuel Fufa
2020-05-04 11:14:52 -07:00
parent 43e789ff9b
commit 385e93249e
10 changed files with 211 additions and 35 deletions

View File

@@ -92,6 +92,11 @@ public class BgDataModel {
*/
public final Map<ShortcutKey, MutableInt> pinnedShortcutCounts = new HashMap<>();
/**
* List of all cached predicted items visible on home screen
*/
public final ArrayList<AppInfo> cachedPredictedItems = new ArrayList<>();
/**
* True if the launcher has permission to access deep shortcuts.
*/
@@ -366,5 +371,10 @@ public class BgDataModel {
void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMap);
void bindAllApplications(AppInfo[] apps);
/**
* Binds predicted appInfos at at available prediction slots.
*/
void bindPredictedItems(List<AppInfo> appInfos, IntArray ranks);
}
}