Adding support for multiple Model clients

Bug: 137568159
Change-Id: Ia4db800b19cc80c695fcb9ea28e07709dfd08c6a
This commit is contained in:
Sunny Goyal
2020-01-05 15:35:29 +05:30
parent 4823b0c99b
commit a7a5bf3101
22 changed files with 655 additions and 288 deletions

View File

@@ -18,14 +18,15 @@ package com.android.launcher3.model;
import android.content.Context;
import android.util.Log;
import androidx.annotation.WorkerThread;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.model.BgDataModel.Callbacks;
import java.util.concurrent.Executor;
import androidx.annotation.WorkerThread;
/**
* Utility class to preload LauncherModel
*/
@@ -50,7 +51,7 @@ public class ModelPreload implements ModelUpdateTask {
@Override
public final void run() {
mModel.startLoaderForResultsIfNotLoaded(
new LoaderResults(mApp, mBgDataModel, mAllAppsList, 0, null));
new LoaderResults(mApp, mBgDataModel, mAllAppsList, new Callbacks[0]));
Log.d(TAG, "Preload completed : " + mModel.isModelLoaded());
onComplete(mModel.isModelLoaded());
}