Fix Keyboard quick switch screenshots and spliscreen launch

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 312449590
Fixes: 292182490
Test: TaplTestsKeyboardQuickSwitch, keyboard quick switched with split app pairs
Change-Id: I0faf2f7d58b39270ad6e5a065cf59f48e0dd23f0
This commit is contained in:
Schneider Victor-tulias
2023-11-28 11:34:56 -05:00
parent d3f3308d12
commit f67c54b48f
5 changed files with 31 additions and 28 deletions

View File

@@ -133,11 +133,20 @@ public class KeyboardQuickSwitchViewController {
GroupTask task = mControllerCallbacks.getTaskAt(index);
if (task == null) {
return Math.max(0, index);
} else if (mOnDesktop) {
}
Task task2 = task.task2;
int runningTaskId = ActivityManagerWrapper.getInstance().getRunningTask().taskId;
if (runningTaskId == task.task1.key.id
|| (task2 != null && runningTaskId == task2.key.id)) {
// Ignore attempts to run the selected task if it is already running.
return -1;
}
if (mOnDesktop) {
UI_HELPER_EXECUTOR.execute(() ->
SystemUiProxy.INSTANCE.get(mKeyboardQuickSwitchView.getContext())
.showDesktopApp(task.task1.key.id));
} else if (task.task2 == null) {
} else if (task2 == null) {
UI_HELPER_EXECUTOR.execute(() ->
ActivityManagerWrapper.getInstance().startActivityFromRecents(
task.task1.key,
@@ -145,8 +154,7 @@ public class KeyboardQuickSwitchViewController {
taskView == null ? mKeyboardQuickSwitchView : taskView, null)
.options));
} else {
mControllers.uiController.launchSplitTasks(
taskView == null ? mKeyboardQuickSwitchView : taskView, task);
mControllers.uiController.launchSplitTasks(task);
}
return -1;
}