Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +3 −2 Original line number Diff line number Diff line Loading @@ -371,7 +371,8 @@ public class RecentTasksController implements TaskStackListenerCallback, * Find the background task that match the given component. */ @Nullable public ActivityManager.RecentTaskInfo findTaskInBackground(ComponentName componentName) { public ActivityManager.RecentTaskInfo findTaskInBackground(ComponentName componentName, int userId) { if (componentName == null) { return null; } Loading @@ -383,7 +384,7 @@ public class RecentTasksController implements TaskStackListenerCallback, if (task.isVisible) { continue; } if (componentName.equals(task.baseIntent.getComponent())) { if (componentName.equals(task.baseIntent.getComponent()) && userId == task.userId) { return task; } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +1 −1 Original line number Diff line number Diff line Loading @@ -723,7 +723,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, // in the background with priority. final ActivityManager.RecentTaskInfo taskInfo = mRecentTasksOptional .map(recentTasks -> recentTasks.findTaskInBackground( intent.getIntent().getComponent())) intent.getIntent().getComponent(), userId1)) .orElse(null); if (taskInfo != null) { startTask(taskInfo.taskId, position, options); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ public class SplitScreenControllerTests extends ShellTestCase { doReturn(topRunningTask).when(mRecentTasks).getTopRunningTask(); // Put the same component into a task in the background ActivityManager.RecentTaskInfo sameTaskInfo = new ActivityManager.RecentTaskInfo(); doReturn(sameTaskInfo).when(mRecentTasks).findTaskInBackground(any()); doReturn(sameTaskInfo).when(mRecentTasks).findTaskInBackground(any(), anyInt()); mSplitScreenController.startIntent(pendingIntent, mContext.getUserId(), null, SPLIT_POSITION_TOP_OR_LEFT, null); Loading @@ -247,7 +247,7 @@ public class SplitScreenControllerTests extends ShellTestCase { SPLIT_POSITION_BOTTOM_OR_RIGHT); // Put the same component into a task in the background doReturn(new ActivityManager.RecentTaskInfo()).when(mRecentTasks) .findTaskInBackground(any()); .findTaskInBackground(any(), anyInt()); mSplitScreenController.startIntent(pendingIntent, mContext.getUserId(), null, SPLIT_POSITION_TOP_OR_LEFT, null); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +3 −2 Original line number Diff line number Diff line Loading @@ -371,7 +371,8 @@ public class RecentTasksController implements TaskStackListenerCallback, * Find the background task that match the given component. */ @Nullable public ActivityManager.RecentTaskInfo findTaskInBackground(ComponentName componentName) { public ActivityManager.RecentTaskInfo findTaskInBackground(ComponentName componentName, int userId) { if (componentName == null) { return null; } Loading @@ -383,7 +384,7 @@ public class RecentTasksController implements TaskStackListenerCallback, if (task.isVisible) { continue; } if (componentName.equals(task.baseIntent.getComponent())) { if (componentName.equals(task.baseIntent.getComponent()) && userId == task.userId) { return task; } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +1 −1 Original line number Diff line number Diff line Loading @@ -723,7 +723,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, // in the background with priority. final ActivityManager.RecentTaskInfo taskInfo = mRecentTasksOptional .map(recentTasks -> recentTasks.findTaskInBackground( intent.getIntent().getComponent())) intent.getIntent().getComponent(), userId1)) .orElse(null); if (taskInfo != null) { startTask(taskInfo.taskId, position, options); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ public class SplitScreenControllerTests extends ShellTestCase { doReturn(topRunningTask).when(mRecentTasks).getTopRunningTask(); // Put the same component into a task in the background ActivityManager.RecentTaskInfo sameTaskInfo = new ActivityManager.RecentTaskInfo(); doReturn(sameTaskInfo).when(mRecentTasks).findTaskInBackground(any()); doReturn(sameTaskInfo).when(mRecentTasks).findTaskInBackground(any(), anyInt()); mSplitScreenController.startIntent(pendingIntent, mContext.getUserId(), null, SPLIT_POSITION_TOP_OR_LEFT, null); Loading @@ -247,7 +247,7 @@ public class SplitScreenControllerTests extends ShellTestCase { SPLIT_POSITION_BOTTOM_OR_RIGHT); // Put the same component into a task in the background doReturn(new ActivityManager.RecentTaskInfo()).when(mRecentTasks) .findTaskInBackground(any()); .findTaskInBackground(any(), anyInt()); mSplitScreenController.startIntent(pendingIntent, mContext.getUserId(), null, SPLIT_POSITION_TOP_OR_LEFT, null); Loading