Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddfc6f7d authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Show non-top tasks in the docked stack in recents." into nyc-dev

parents 58691b6f 64ae08aa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -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);
    }

    /**
@@ -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() {
+14 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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;

@@ -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 |
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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;
            }
        }
@@ -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;
            }
        }
@@ -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