Merge "Add ability to get tasks per displayId" into tm-qpr-dev
This commit is contained in:
@@ -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_LOCKED;
|
||||||
import static android.app.ActivityManager.LOCK_TASK_MODE_NONE;
|
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 static android.app.ActivityTaskManager.getService;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
@@ -45,6 +44,7 @@ import android.os.ServiceManager;
|
|||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Display;
|
||||||
import android.view.IRecentsAnimationController;
|
import android.view.IRecentsAnimationController;
|
||||||
import android.view.IRecentsAnimationRunner;
|
import android.view.IRecentsAnimationRunner;
|
||||||
import android.view.RemoteAnimationTarget;
|
import android.view.RemoteAnimationTarget;
|
||||||
@@ -111,6 +111,13 @@ public class ActivityManagerWrapper {
|
|||||||
return tasks.get(0);
|
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 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
|
* 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
|
* @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.
|
* 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
|
// Note: The set of running tasks from the system is ordered by recency
|
||||||
List<ActivityManager.RunningTaskInfo> tasks =
|
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()]);
|
return tasks.toArray(new RunningTaskInfo[tasks.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user