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

Commit 3d2fdf9c authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Add ability to get tasks per displayId" into tm-qpr-dev am:...

Merge "Merge "Add ability to get tasks per displayId" into tm-qpr-dev am: 179ba8d0" into tm-qpr-dev-plus-aosp am: afa1ef56

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21732696



Change-Id: I82abc8772b9e157665abd33881a0388c742e837b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6beb9e63 afa1ef56
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.shared.system;

import static android.app.ActivityManager.LOCK_TASK_MODE_LOCKED;
import static android.app.ActivityManager.LOCK_TASK_MODE_NONE;
import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED;
import static android.app.ActivityTaskManager.getService;

import android.annotation.NonNull;
@@ -45,6 +44,7 @@ import android.os.ServiceManager;
import android.os.SystemClock;
import android.provider.Settings;
import android.util.Log;
import android.view.Display;
import android.view.IRecentsAnimationController;
import android.view.IRecentsAnimationRunner;
import android.view.RemoteAnimationTarget;
@@ -111,6 +111,13 @@ public class ActivityManagerWrapper {
        return tasks.get(0);
    }

    /**
     * @see #getRunningTasks(boolean , int)
     */
    public ActivityManager.RunningTaskInfo[] getRunningTasks(boolean filterOnlyVisibleRecents) {
        return getRunningTasks(filterOnlyVisibleRecents, Display.INVALID_DISPLAY);
    }

    /**
     * We ask for {@link #NUM_RECENT_ACTIVITIES_REQUEST} activities because when in split screen,
     * we'll get back 2 activities for each split app and one for launcher. Launcher might be more
@@ -120,10 +127,12 @@ public class ActivityManagerWrapper {
     * @return an array of up to {@link #NUM_RECENT_ACTIVITIES_REQUEST} running tasks
     *         filtering only for tasks that can be visible in the recent tasks list.
     */
    public ActivityManager.RunningTaskInfo[] getRunningTasks(boolean filterOnlyVisibleRecents) {
    public ActivityManager.RunningTaskInfo[] getRunningTasks(boolean filterOnlyVisibleRecents,
            int displayId) {
        // Note: The set of running tasks from the system is ordered by recency
        List<ActivityManager.RunningTaskInfo> tasks =
                mAtm.getTasks(NUM_RECENT_ACTIVITIES_REQUEST, filterOnlyVisibleRecents);
                mAtm.getTasks(NUM_RECENT_ACTIVITIES_REQUEST,
                        filterOnlyVisibleRecents, /* keepInExtras= */ false, displayId);
        return tasks.toArray(new RunningTaskInfo[tasks.size()]);
    }