Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recents; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.view.View.MeasureSpec; import android.app.ActivityManager; Loading Loading @@ -443,7 +444,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Launch the task ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); ssp.startActivityFromRecents( mContext, toTask.key, toTask.title, launchOpts, INVALID_STACK_ID); } /** Loading Loading @@ -515,7 +517,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener MetricsLogger.count(mContext, "overview_affiliated_task_launch", 1); // Launch the task ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); ssp.startActivityFromRecents( mContext, toTask.key, toTask.title, launchOpts, INVALID_STACK_ID); } public void showNextAffiliatedTask() { Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; Loading Loading @@ -940,7 +941,7 @@ public class SystemServicesProxy { /** Starts an activity from recents. */ public boolean startActivityFromRecents(Context context, Task.TaskKey taskKey, String taskName, ActivityOptions options) { ActivityOptions options, int stackId) { if (mIam != null) { try { if (taskKey.stackId == DOCKED_STACK_ID) { Loading @@ -950,6 +951,11 @@ public class SystemServicesProxy { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(FULLSCREEN_WORKSPACE_STACK_ID); } else if (stackId != INVALID_STACK_ID){ if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(stackId); } mIam.startActivityFromRecents( taskKey.id, options == null ? null : options.toBundle()); Loading packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvTransitionHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.model.TaskStack; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; public class RecentsTvTransitionHelper { private static final String TAG = "RecentsTvTransitionHelper"; Loading Loading @@ -90,7 +92,7 @@ public class RecentsTvTransitionHelper { private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskCardView taskView, ActivityOptions opts,final ActivityOptions.OnAnimationStartedListener animStartedListener) { SystemServicesProxy ssp = Recents.getSystemServices(); if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts, INVALID_STACK_ID)) { // Keep track of the index of the task launch int taskIndexFromFront = 0; int taskIndex = stack.indexOfStackTask(task); Loading packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvView.java +4 −2 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class RecentsTvView extends FrameLayout { private void launchTaskFomRecents(final Task task, boolean animate) { if (!animate) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null, INVALID_STACK_ID); return; } mTaskStackHorizontalView.requestFocus(); Loading @@ -164,7 +165,8 @@ public class RecentsTvView extends FrameLayout { // task with no animation. Log.e(TAG, "Card view for task : " + task + ", returned null."); SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null, INVALID_STACK_ID); } mTaskStackHorizontalView.removeOnScrollListener(mScrollListener); } Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java +7 −5 Original line number Diff line number Diff line Loading @@ -149,7 +149,8 @@ public class RecentsTransitionHelper { if (taskView == null) { // If there is no task view, then we do not need to worry about animating out occluding // task views, and we can launch immediately startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener, destinationStack); } else { LaunchTaskStartedEvent launchStartedEvent = new LaunchTaskStartedEvent(taskView, screenPinningRequested); Loading @@ -158,14 +159,14 @@ public class RecentsTransitionHelper { @Override public void run() { startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); animStartedListener, destinationStack); } }); EventBus.getDefault().send(launchStartedEvent); } else { EventBus.getDefault().send(launchStartedEvent); startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); animStartedListener, destinationStack); } } Recents.getSystemServices().sendCloseSystemWindows( Loading Loading @@ -194,12 +195,13 @@ public class RecentsTransitionHelper { * * @param taskView this is the {@link TaskView} that we are launching from. This can be null if * we are toggling recents and the launch-to task is now offscreen. * @param destinationStack id of the stack to put the task into. */ private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) { final OnAnimationStartedListener animStartedListener, int destinationStack) { SystemServicesProxy ssp = Recents.getSystemServices(); if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts, destinationStack)) { // Keep track of the index of the task launch int taskIndexFromFront = 0; int taskIndex = stack.indexOfStackTask(task); Loading Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recents; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.view.View.MeasureSpec; import android.app.ActivityManager; Loading Loading @@ -443,7 +444,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Launch the task ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); ssp.startActivityFromRecents( mContext, toTask.key, toTask.title, launchOpts, INVALID_STACK_ID); } /** Loading Loading @@ -515,7 +517,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener MetricsLogger.count(mContext, "overview_affiliated_task_launch", 1); // Launch the task ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); ssp.startActivityFromRecents( mContext, toTask.key, toTask.title, launchOpts, INVALID_STACK_ID); } public void showNextAffiliatedTask() { Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; Loading Loading @@ -940,7 +941,7 @@ public class SystemServicesProxy { /** Starts an activity from recents. */ public boolean startActivityFromRecents(Context context, Task.TaskKey taskKey, String taskName, ActivityOptions options) { ActivityOptions options, int stackId) { if (mIam != null) { try { if (taskKey.stackId == DOCKED_STACK_ID) { Loading @@ -950,6 +951,11 @@ public class SystemServicesProxy { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(FULLSCREEN_WORKSPACE_STACK_ID); } else if (stackId != INVALID_STACK_ID){ if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(stackId); } mIam.startActivityFromRecents( taskKey.id, options == null ? null : options.toBundle()); Loading
packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvTransitionHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.model.TaskStack; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; public class RecentsTvTransitionHelper { private static final String TAG = "RecentsTvTransitionHelper"; Loading Loading @@ -90,7 +92,7 @@ public class RecentsTvTransitionHelper { private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskCardView taskView, ActivityOptions opts,final ActivityOptions.OnAnimationStartedListener animStartedListener) { SystemServicesProxy ssp = Recents.getSystemServices(); if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts, INVALID_STACK_ID)) { // Keep track of the index of the task launch int taskIndexFromFront = 0; int taskIndex = stack.indexOfStackTask(task); Loading
packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvView.java +4 −2 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class RecentsTvView extends FrameLayout { private void launchTaskFomRecents(final Task task, boolean animate) { if (!animate) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null, INVALID_STACK_ID); return; } mTaskStackHorizontalView.requestFocus(); Loading @@ -164,7 +165,8 @@ public class RecentsTvView extends FrameLayout { // task with no animation. Log.e(TAG, "Card view for task : " + task + ", returned null."); SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null, INVALID_STACK_ID); } mTaskStackHorizontalView.removeOnScrollListener(mScrollListener); } Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java +7 −5 Original line number Diff line number Diff line Loading @@ -149,7 +149,8 @@ public class RecentsTransitionHelper { if (taskView == null) { // If there is no task view, then we do not need to worry about animating out occluding // task views, and we can launch immediately startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener, destinationStack); } else { LaunchTaskStartedEvent launchStartedEvent = new LaunchTaskStartedEvent(taskView, screenPinningRequested); Loading @@ -158,14 +159,14 @@ public class RecentsTransitionHelper { @Override public void run() { startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); animStartedListener, destinationStack); } }); EventBus.getDefault().send(launchStartedEvent); } else { EventBus.getDefault().send(launchStartedEvent); startTaskActivity(stack, task, taskView, opts, transitionFuture, animStartedListener); animStartedListener, destinationStack); } } Recents.getSystemServices().sendCloseSystemWindows( Loading Loading @@ -194,12 +195,13 @@ public class RecentsTransitionHelper { * * @param taskView this is the {@link TaskView} that we are launching from. This can be null if * we are toggling recents and the launch-to task is now offscreen. * @param destinationStack id of the stack to put the task into. */ private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) { final OnAnimationStartedListener animStartedListener, int destinationStack) { SystemServicesProxy ssp = Recents.getSystemServices(); if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts, destinationStack)) { // Keep track of the index of the task launch int taskIndexFromFront = 0; int taskIndex = stack.indexOfStackTask(task); Loading