Loading quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java +12 −4 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; } Loading quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +2 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.animation.AnimatorSet; import android.os.RemoteException; import android.util.Log; import android.view.TaskTransitionSpec; import android.view.View; import android.view.WindowManagerGlobal; import androidx.annotation.NonNull; Loading Loading @@ -386,8 +385,8 @@ public class LauncherTaskbarUIController extends TaskbarUIController { } @Override public void launchSplitTasks(@NonNull View taskView, @NonNull GroupTask groupTask) { mLauncher.launchSplitTasks(taskView, groupTask); public void launchSplitTasks(@NonNull GroupTask groupTask) { mLauncher.launchSplitTasks(groupTask); } @Override Loading quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +2 −4 Original line number Diff line number Diff line Loading @@ -297,11 +297,9 @@ public class TaskbarUIController { } /** * Launches the focused task in splitscreen. * * No-op if the view is not yet open. * Launches the given task in split-screen. */ public void launchSplitTasks(@NonNull View taskview, @NonNull GroupTask groupTask) { } public void launchSplitTasks(@NonNull GroupTask groupTask) { } /** * Returns the matching view (if any) in the taskbar. Loading quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +9 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.os.Trace.TRACE_TAG_APP; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.PENDING_SPLIT_SELECT_INFO; import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.RUNTIME_STATE; Loading @@ -34,8 +35,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import static com.android.launcher3.config.FeatureFlags.ENABLE_HOME_TRANSITION_LISTENER; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID; import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition; Loading Loading @@ -1263,24 +1262,19 @@ public class QuickstepLauncher extends Launcher { /** * Launches the given {@link GroupTask} in splitscreen. * * If the second split task is missing, launches the first task normally. */ public void launchSplitTasks(@NonNull View taskView, @NonNull GroupTask groupTask) { if (groupTask.task2 == null) { UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance().startActivityFromRecents( groupTask.task1.key, getActivityLaunchOptions(taskView, null).options)); return; } public void launchSplitTasks(@NonNull GroupTask groupTask) { // Top/left and bottom/right tasks respectively. Task task1 = groupTask.task1; // task2 should never be null when calling this method. Allow a crash to catch invalid calls Task task2 = groupTask.task2; mSplitSelectStateController.launchExistingSplitPair( null /* launchingTaskView */, groupTask.task1.key.id, groupTask.task2.key.id, task1.key.id, task2.key.id, SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT, /* callback= */ success -> mSplitSelectStateController.resetState(), /* freezeTaskList= */ true, /* freezeTaskList= */ false, groupTask.mSplitBounds == null ? SNAP_TO_50_50 : groupTask.mSplitBounds.snapPosition); Loading quickstep/src/com/android/quickstep/TaskThumbnailCache.java +6 −2 Original line number Diff line number Diff line Loading @@ -195,11 +195,15 @@ public class TaskThumbnailCache { return null; } CancellableTask<ThumbnailData> request = new CancellableTask<ThumbnailData>() { CancellableTask<ThumbnailData> request = new CancellableTask<>() { @Override public ThumbnailData getResultOnBg() { return ActivityManagerWrapper.getInstance().getTaskThumbnail( ThumbnailData thumbnailData = ActivityManagerWrapper.getInstance().getTaskThumbnail( key.id, lowResolution); if (thumbnailData.thumbnail != null) { return thumbnailData; } return ActivityManagerWrapper.getInstance().takeTaskThumbnail(key.id); } @Override Loading Loading
quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java +12 −4 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; } Loading
quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +2 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.animation.AnimatorSet; import android.os.RemoteException; import android.util.Log; import android.view.TaskTransitionSpec; import android.view.View; import android.view.WindowManagerGlobal; import androidx.annotation.NonNull; Loading Loading @@ -386,8 +385,8 @@ public class LauncherTaskbarUIController extends TaskbarUIController { } @Override public void launchSplitTasks(@NonNull View taskView, @NonNull GroupTask groupTask) { mLauncher.launchSplitTasks(taskView, groupTask); public void launchSplitTasks(@NonNull GroupTask groupTask) { mLauncher.launchSplitTasks(groupTask); } @Override Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +2 −4 Original line number Diff line number Diff line Loading @@ -297,11 +297,9 @@ public class TaskbarUIController { } /** * Launches the focused task in splitscreen. * * No-op if the view is not yet open. * Launches the given task in split-screen. */ public void launchSplitTasks(@NonNull View taskview, @NonNull GroupTask groupTask) { } public void launchSplitTasks(@NonNull GroupTask groupTask) { } /** * Returns the matching view (if any) in the taskbar. Loading
quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +9 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.os.Trace.TRACE_TAG_APP; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.PENDING_SPLIT_SELECT_INFO; import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.RUNTIME_STATE; Loading @@ -34,8 +35,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import static com.android.launcher3.config.FeatureFlags.ENABLE_HOME_TRANSITION_LISTENER; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID; import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition; Loading Loading @@ -1263,24 +1262,19 @@ public class QuickstepLauncher extends Launcher { /** * Launches the given {@link GroupTask} in splitscreen. * * If the second split task is missing, launches the first task normally. */ public void launchSplitTasks(@NonNull View taskView, @NonNull GroupTask groupTask) { if (groupTask.task2 == null) { UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance().startActivityFromRecents( groupTask.task1.key, getActivityLaunchOptions(taskView, null).options)); return; } public void launchSplitTasks(@NonNull GroupTask groupTask) { // Top/left and bottom/right tasks respectively. Task task1 = groupTask.task1; // task2 should never be null when calling this method. Allow a crash to catch invalid calls Task task2 = groupTask.task2; mSplitSelectStateController.launchExistingSplitPair( null /* launchingTaskView */, groupTask.task1.key.id, groupTask.task2.key.id, task1.key.id, task2.key.id, SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT, /* callback= */ success -> mSplitSelectStateController.resetState(), /* freezeTaskList= */ true, /* freezeTaskList= */ false, groupTask.mSplitBounds == null ? SNAP_TO_50_50 : groupTask.mSplitBounds.snapPosition); Loading
quickstep/src/com/android/quickstep/TaskThumbnailCache.java +6 −2 Original line number Diff line number Diff line Loading @@ -195,11 +195,15 @@ public class TaskThumbnailCache { return null; } CancellableTask<ThumbnailData> request = new CancellableTask<ThumbnailData>() { CancellableTask<ThumbnailData> request = new CancellableTask<>() { @Override public ThumbnailData getResultOnBg() { return ActivityManagerWrapper.getInstance().getTaskThumbnail( ThumbnailData thumbnailData = ActivityManagerWrapper.getInstance().getTaskThumbnail( key.id, lowResolution); if (thumbnailData.thumbnail != null) { return thumbnailData; } return ActivityManagerWrapper.getInstance().takeTaskThumbnail(key.id); } @Override Loading