Load Delegate Items in correct order when loading Launcher Data.

Bug: 251502424
Test: Loaded and bound the workspace properly.
Change-Id: Ia6d609ffa21c5036cb48e464d3e8d4fa561cb008
This commit is contained in:
Stefan Andonian
2023-04-07 19:28:05 +00:00
parent 75f7bbc150
commit e4609a27bd
7 changed files with 147 additions and 70 deletions

View File

@@ -20,6 +20,7 @@ import static com.android.launcher3.util.PackageManagerHelper.hasShortcutsPermis
import android.content.Context;
import android.content.pm.ShortcutInfo;
import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;
import com.android.launcher3.LauncherAppState;
@@ -68,9 +69,7 @@ public class ModelDelegate implements ResourceBasedOverride {
this.mContext = context;
}
/**
* Called periodically to validate and update any data
*/
/** Called periodically to validate and update any data */
@WorkerThread
public void validateData() {
if (hasShortcutsPermission(mApp.getContext())
@@ -79,36 +78,32 @@ public class ModelDelegate implements ResourceBasedOverride {
}
}
/**
* Load hot seat items if any in the data model
*/
/** Load workspace items (for example, those in the hot seat) if any in the data model */
@WorkerThread
public void loadHotseatItems(UserManagerState ums,
Map<ShortcutKey, ShortcutInfo> pinnedShortcuts) { }
public void loadAndBindWorkspaceItems(@NonNull UserManagerState ums,
@NonNull BgDataModel.Callbacks[] callbacks,
@NonNull Map<ShortcutKey, ShortcutInfo> pinnedShortcuts) { }
/**
* Load all apps items if any in the data model
*/
/** Load all apps items if any in the data model */
@WorkerThread
public void loadAllAppsItems(UserManagerState ums,
Map<ShortcutKey, ShortcutInfo> pinnedShortcuts) { }
public void loadAndBindAllAppsItems(@NonNull UserManagerState ums,
@NonNull BgDataModel.Callbacks[] callbacks,
@NonNull Map<ShortcutKey, ShortcutInfo> pinnedShortcuts) { }
/**
* Load widget recommendation items if any in the data model
*/
/** Load other items like widget recommendations if any in the data model */
@WorkerThread
public void loadWidgetsRecommendationItems() { }
public void loadAndBindOtherItems(@NonNull BgDataModel.Callbacks[] callbacks) { }
/**
* Marks the ModelDelegate as active
*/
/** binds everything not bound by launcherBinder */
@WorkerThread
public void bindAllModelExtras(@NonNull BgDataModel.Callbacks[] callbacks) { }
/** Marks the ModelDelegate as active */
public void markActive() { }
/**
* Load String cache
*/
/** Load String cache */
@WorkerThread
public void loadStringCache(StringCache cache) {
public void loadStringCache(@NonNull StringCache cache) {
cache.loadStrings(mContext);
}