Fix folder UI open regression when tapping edit text / Fix NPE

Bug: 149835166
Bug: 149839789



Change-Id: I295cc72e4228249794eae11f177226179f2a175f
This commit is contained in:
Hyunyoung Song
2020-02-19 09:14:49 -08:00
parent bd5048a156
commit 356a9f05c4
3 changed files with 23 additions and 6 deletions

View File

@@ -70,11 +70,25 @@ public class FolderNameProvider implements ResourceBasedOverride {
return fnp;
}
public static FolderNameProvider newInstance(Context context, List<AppInfo> appInfos,
IntSparseArrayMap<FolderInfo> folderInfos) {
FolderNameProvider fnp = Overrides.getObject(FolderNameProvider.class,
context.getApplicationContext(), R.string.folder_name_provider_class);
fnp.load(appInfos, folderInfos);
return fnp;
}
private void load(Context context) {
LauncherAppState.getInstance(context).getModel().enqueueModelUpdateTask(
new FolderNameWorker());
}
private void load(List<AppInfo> appInfos, IntSparseArrayMap<FolderInfo> folderInfos) {
mAppInfos = appInfos;
mFolderInfos = folderInfos;
}
/**
* Generate and rank the suggested Folder names.
*/