Fixes two bugs with findLastActiveTasksAndRunCallback()
This CL changes findLastActiveTasksAndRunCallback to return a fixed array rather than an ArrayList. 1) This fixes a (minor) crash with app pairs, where we performed get(0) on an empty array when no running tasks were found. 2) This also fixes a live bug where app pairs would launch apps in the wrong order if app 1 was not found in running tasks, but app 2 was. The function should be more robust now, preserving the indexing of the input keys. Fixes: 316053131 Test: Clear all tasks from Overview, launch an app pair, launch succeeds Flag: ACONFIG com.android.wm.shell.enable_app_pairs DEVELOPMENT Change-Id: I51d8ba823a2ec57e9ecfeede956e0afce1d653f4
This commit is contained in:
@@ -644,7 +644,7 @@ public class QuickstepLauncher extends Launcher {
|
||||
Collections.singletonList(splitSelectSource.itemInfo.getComponentKey()),
|
||||
false /* findExactPairMatch */,
|
||||
foundTasks -> {
|
||||
@Nullable Task foundTask = foundTasks.get(0);
|
||||
@Nullable Task foundTask = foundTasks[0];
|
||||
boolean taskWasFound = foundTask != null;
|
||||
splitSelectSource.alreadyRunningTaskId = taskWasFound
|
||||
? foundTask.key.id
|
||||
|
||||
Reference in New Issue
Block a user