Loading core/java/android/app/ActivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -1410,10 +1410,10 @@ public class ActivityManager { public static final int RECENT_IGNORE_HOME_STACK_TASKS = 0x0008; /** * Ignores all tasks that are on the docked stack. * Ignores the top task in the docked stack. * @hide */ public static final int RECENT_INGORE_DOCKED_STACK_TASKS = 0x0010; public static final int RECENT_INGORE_DOCKED_STACK_TOP_TASK = 0x0010; /** * Ignores all tasks that are on the pinned stack. Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Launch the task ssp.startActivityFromRecents(mContext, toTask.key.id, toTask.title, launchOpts); ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); } /** Loading Loading @@ -510,7 +510,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener MetricsLogger.count(mContext, "overview_affiliated_task_launch", 1); // Launch the task ssp.startActivityFromRecents(mContext, toTask.key.id, toTask.title, launchOpts); ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); } public void showNextAffiliatedTask() { Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +14 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.recents.misc; 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.PINNED_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; Loading Loading @@ -77,6 +78,7 @@ import com.android.internal.os.BackgroundThread; import com.android.systemui.R; import com.android.systemui.recents.RecentsDebugFlags; import com.android.systemui.recents.RecentsImpl; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.tv.RecentsTvImpl; import com.android.systemui.recents.model.ThumbnailData; Loading Loading @@ -284,7 +286,7 @@ public class SystemServicesProxy { int numTasksToQuery = Math.max(minNumTasksToQuery, numLatestTasks); List<ActivityManager.RecentTaskInfo> tasks = mAm.getRecentTasksForUser(numTasksToQuery, ActivityManager.RECENT_IGNORE_HOME_STACK_TASKS | ActivityManager.RECENT_INGORE_DOCKED_STACK_TASKS | ActivityManager.RECENT_INGORE_DOCKED_STACK_TOP_TASK | ActivityManager.RECENT_INGORE_PINNED_STACK_TASKS | ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES | Loading Loading @@ -962,11 +964,20 @@ public class SystemServicesProxy { } /** Starts an activity from recents. */ public boolean startActivityFromRecents(Context context, int taskId, String taskName, public boolean startActivityFromRecents(Context context, Task.TaskKey taskKey, String taskName, ActivityOptions options) { if (mIam != null) { try { mIam.startActivityFromRecents(taskId, options == null ? null : options.toBundle()); if (taskKey.stackId == DOCKED_STACK_ID) { // We show non-visible docked tasks in Recents, but we always want to launch // them in the fullscreen stack. if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(FULLSCREEN_WORKSPACE_STACK_ID); } mIam.startActivityFromRecents( taskKey.id, options == null ? null : options.toBundle()); return true; } catch (Exception e) { Log.e(TAG, context.getString(R.string.recents_launch_error_message, taskName), e); Loading packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvTransitionHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,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.id, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { // 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 +3 −3 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public class RecentsTvView extends FrameLayout { Task task = mTaskStackHorizontalView.getFocusedTask(); if (task != null) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading @@ -123,7 +123,7 @@ public class RecentsTvView extends FrameLayout { Task task = stack.getLaunchTarget(); if (task != null) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading @@ -140,7 +140,7 @@ public class RecentsTvView extends FrameLayout { TaskCardView tv = taskViews.get(j); if (tv.getTask() == task) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading Loading
core/java/android/app/ActivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -1410,10 +1410,10 @@ public class ActivityManager { public static final int RECENT_IGNORE_HOME_STACK_TASKS = 0x0008; /** * Ignores all tasks that are on the docked stack. * Ignores the top task in the docked stack. * @hide */ public static final int RECENT_INGORE_DOCKED_STACK_TASKS = 0x0010; public static final int RECENT_INGORE_DOCKED_STACK_TOP_TASK = 0x0010; /** * Ignores all tasks that are on the pinned stack. Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Launch the task ssp.startActivityFromRecents(mContext, toTask.key.id, toTask.title, launchOpts); ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); } /** Loading Loading @@ -510,7 +510,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener MetricsLogger.count(mContext, "overview_affiliated_task_launch", 1); // Launch the task ssp.startActivityFromRecents(mContext, toTask.key.id, toTask.title, launchOpts); ssp.startActivityFromRecents(mContext, toTask.key, toTask.title, launchOpts); } public void showNextAffiliatedTask() { Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +14 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.recents.misc; 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.PINNED_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; Loading Loading @@ -77,6 +78,7 @@ import com.android.internal.os.BackgroundThread; import com.android.systemui.R; import com.android.systemui.recents.RecentsDebugFlags; import com.android.systemui.recents.RecentsImpl; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.tv.RecentsTvImpl; import com.android.systemui.recents.model.ThumbnailData; Loading Loading @@ -284,7 +286,7 @@ public class SystemServicesProxy { int numTasksToQuery = Math.max(minNumTasksToQuery, numLatestTasks); List<ActivityManager.RecentTaskInfo> tasks = mAm.getRecentTasksForUser(numTasksToQuery, ActivityManager.RECENT_IGNORE_HOME_STACK_TASKS | ActivityManager.RECENT_INGORE_DOCKED_STACK_TASKS | ActivityManager.RECENT_INGORE_DOCKED_STACK_TOP_TASK | ActivityManager.RECENT_INGORE_PINNED_STACK_TASKS | ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES | Loading Loading @@ -962,11 +964,20 @@ public class SystemServicesProxy { } /** Starts an activity from recents. */ public boolean startActivityFromRecents(Context context, int taskId, String taskName, public boolean startActivityFromRecents(Context context, Task.TaskKey taskKey, String taskName, ActivityOptions options) { if (mIam != null) { try { mIam.startActivityFromRecents(taskId, options == null ? null : options.toBundle()); if (taskKey.stackId == DOCKED_STACK_ID) { // We show non-visible docked tasks in Recents, but we always want to launch // them in the fullscreen stack. if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchStackId(FULLSCREEN_WORKSPACE_STACK_ID); } mIam.startActivityFromRecents( taskKey.id, options == null ? null : options.toBundle()); return true; } catch (Exception e) { Log.e(TAG, context.getString(R.string.recents_launch_error_message, taskName), e); Loading
packages/SystemUI/src/com/android/systemui/recents/tv/views/RecentsTvTransitionHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,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.id, task.title, opts)) { if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) { // 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 +3 −3 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public class RecentsTvView extends FrameLayout { Task task = mTaskStackHorizontalView.getFocusedTask(); if (task != null) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading @@ -123,7 +123,7 @@ public class RecentsTvView extends FrameLayout { Task task = stack.getLaunchTarget(); if (task != null) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading @@ -140,7 +140,7 @@ public class RecentsTvView extends FrameLayout { TaskCardView tv = taskViews.get(j); if (tv.getTask() == task) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.startActivityFromRecents(getContext(), task.key.id, task.title, null); ssp.startActivityFromRecents(getContext(), task.key, task.title, null); return true; } } Loading