Add two panel home support for page binding logic

There's a logic which prioritizes the binding for the
current page and defers the other pages' binding.
If two panel home is enabled, we want to bind both pages
together. LauncherPageRestoreHelper has been created to
contain the logic for persisting restoring and calculating
which pages to load immediately.

Test: manual + run LauncherPageRestoreHelperTest robo test
Bug: 174464691
Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
This commit is contained in:
Andras Kloczl
2021-05-14 12:21:30 +02:00
parent f3649f5e98
commit 55edfe55f7
17 changed files with 499 additions and 85 deletions

View File

@@ -446,15 +446,16 @@ public class BgDataModel {
int FLAG_QUIET_MODE_CHANGE_PERMISSION = 1 << 2;
/**
* Returns the page number to bind first, synchronously if possible or -1
* Returns an IntSet of page numbers to bind first, synchronously if possible
* or an empty IntSet
*/
int getPageToBindSynchronously();
IntSet getPagesToBindSynchronously();
void clearPendingBinds();
void startBinding();
void bindItems(List<ItemInfo> shortcuts, boolean forceAnimateIcons);
void bindScreens(IntArray orderedScreenIds);
void finishFirstPageBind(ViewOnDrawExecutor executor);
void finishBindingItems(int pageBoundFirst);
void finishBindingItems(IntSet pagesBoundFirst);
void preAddApps();
void bindAppsAdded(IntArray newScreens,
ArrayList<ItemInfo> addNotAnimated, ArrayList<ItemInfo> addAnimated);
@@ -468,7 +469,7 @@ public class BgDataModel {
void bindRestoreItemsChange(HashSet<ItemInfo> updates);
void bindWorkspaceComponentsRemoved(ItemInfoMatcher matcher);
void bindAllWidgets(List<WidgetsListBaseEntry> widgets);
void onPageBoundSynchronously(int page);
void onPagesBoundSynchronously(IntSet pages);
void executeOnNextDraw(ViewOnDrawExecutor executor);
void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMap);