Merge changes from topic "presubmit-am-a8c798abe8b24577a107553295b8cd0f" into sc-v2-dev-plus-aosp

* changes:
  [automerge] Add null check for null task in getItemInfo() 2p: 73c6288038
  Add null check for null task in getItemInfo()
This commit is contained in:
Vinit Nayak
2022-02-16 21:23:47 +00:00
committed by Android (Google) Code Review

View File

@@ -462,11 +462,15 @@ public class TaskView extends FrameLayout implements Reusable {
return getItemInfo(mTask);
}
protected WorkspaceItemInfo getItemInfo(Task task) {
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
protected WorkspaceItemInfo getItemInfo(@Nullable Task task) {
WorkspaceItemInfo stubInfo = new WorkspaceItemInfo();
stubInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_TASK;
stubInfo.container = LauncherSettings.Favorites.CONTAINER_TASKSWITCHER;
if (task == null) {
return stubInfo;
}
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
stubInfo.user = componentKey.user;
stubInfo.intent = new Intent().setComponent(componentKey.componentName);
stubInfo.title = task.title;