Add null-check to findLastActiveTaskAndRunCallback

ItemInfo.getTargetComponent is nullable, so we can't always create a ComponentKey. Added a null-check and proper creation of ComponentKeys

Flag: not needed
Fixes: 286053950
Test: started and completed splitscreen selection from home, taskbar and overview
Change-Id: Ifa30f194ae064fab8aad79c5116f8c859dfd8cf1
This commit is contained in:
Schneider Victor-tulias
2023-06-06 10:55:54 -07:00
parent 014a684343
commit ab51f2110a
5 changed files with 19 additions and 19 deletions

View File

@@ -98,7 +98,6 @@ import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.touch.ItemClickHandler.ItemClickProxy;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.NavigationMode;
@@ -939,9 +938,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
if (recents == null) {
return;
}
ComponentKey componentToBeLaunched = new ComponentKey(info.getTargetComponent(), info.user);
recents.getSplitSelectController().findLastActiveTaskAndRunCallback(
componentToBeLaunched,
info.getComponentKey(),
foundTask -> {
if (foundTask != null) {
TaskView foundTaskView =