Merge "Rename Stack to Task related terms (1/n)"
This commit is contained in:
committed by
Android (Google) Code Review
commit
db553dcbbd
@@ -194,7 +194,7 @@ import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.ActivityState.STARTED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPING;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.TaskPersister.DEBUG;
|
||||
import static com.android.server.wm.TaskPersister.IMAGE_EXTENSION;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
|
||||
@@ -4881,7 +4881,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
*/
|
||||
private boolean shouldBeResumed(ActivityRecord activeActivity) {
|
||||
return shouldMakeActive(activeActivity) && isFocusable()
|
||||
&& getTask().getVisibility(activeActivity) == STACK_VISIBILITY_VISIBLE
|
||||
&& getTask().getVisibility(activeActivity) == TASK_VISIBILITY_VISIBLE
|
||||
&& canResumeByCompat();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_ALL;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_CLEANUP;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_IDLE;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_IDLE;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_PAUSE;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RECENTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_ROOT_TASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_SWITCH;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_TASKS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
|
||||
@@ -66,14 +66,14 @@ import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_N
|
||||
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_ALLOWLISTED;
|
||||
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE;
|
||||
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE_PRIV;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE;
|
||||
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
|
||||
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
|
||||
import static com.android.server.wm.Task.ActivityState.PAUSED;
|
||||
import static com.android.server.wm.Task.ActivityState.PAUSING;
|
||||
import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_PINNED_TASK;
|
||||
import static com.android.server.wm.Task.REPARENT_KEEP_STACK_AT_FRONT;
|
||||
import static com.android.server.wm.Task.REPARENT_KEEP_ROOT_TASK_AT_FRONT;
|
||||
import static com.android.server.wm.Task.TAG_CLEANUP;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
|
||||
@@ -158,7 +158,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
private static final String TAG_IDLE = TAG + POSTFIX_IDLE;
|
||||
private static final String TAG_PAUSE = TAG + POSTFIX_PAUSE;
|
||||
private static final String TAG_RECENTS = TAG + POSTFIX_RECENTS;
|
||||
private static final String TAG_STACK = TAG + POSTFIX_STACK;
|
||||
private static final String TAG_ROOT_TASK = TAG + POSTFIX_ROOT_TASK;
|
||||
private static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
|
||||
static final String TAG_TASKS = TAG + POSTFIX_TASKS;
|
||||
|
||||
@@ -526,7 +526,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
int candidateTaskId = nextTaskIdForUser(currentTaskId, userId);
|
||||
while (mRecentTasks.containsTaskId(candidateTaskId, userId)
|
||||
|| mRootWindowContainer.anyTaskForId(
|
||||
candidateTaskId, MATCH_TASK_IN_STACKS_OR_RECENT_TASKS) != null) {
|
||||
candidateTaskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) {
|
||||
candidateTaskId = nextTaskIdForUser(candidateTaskId, userId);
|
||||
if (candidateTaskId == currentTaskId) {
|
||||
// Something wrong!
|
||||
@@ -1360,8 +1360,8 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
|
||||
if (stack != currentStack) {
|
||||
moveHomeStackToFrontIfNeeded(flags, stack.getDisplayArea(), reason);
|
||||
task.reparent(stack, ON_TOP, REPARENT_KEEP_STACK_AT_FRONT, !ANIMATE, DEFER_RESUME,
|
||||
reason);
|
||||
task.reparent(stack, ON_TOP, REPARENT_KEEP_ROOT_TASK_AT_FRONT, !ANIMATE,
|
||||
DEFER_RESUME, reason);
|
||||
currentStack = stack;
|
||||
reparented = true;
|
||||
// task.reparent() should already placed the task on top,
|
||||
@@ -1385,7 +1385,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
currentStack.moveTaskToFront(task, false /* noAnimation */, options,
|
||||
r == null ? null : r.appTimeTracker, reason);
|
||||
|
||||
if (DEBUG_STACK) Slog.d(TAG_STACK,
|
||||
if (DEBUG_ROOT_TASK) Slog.d(TAG_ROOT_TASK,
|
||||
"findTaskToMoveToFront: moved to front of stack=" + currentStack);
|
||||
|
||||
handleNonResizableTaskIfNeeded(task, WINDOWING_MODE_UNDEFINED,
|
||||
@@ -1502,7 +1502,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
boolean removeTaskById(int taskId, boolean killProcess, boolean removeFromRecents,
|
||||
String reason) {
|
||||
final Task task =
|
||||
mRootWindowContainer.anyTaskForId(taskId, MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task != null) {
|
||||
removeTask(task, killProcess, removeFromRecents, reason);
|
||||
return true;
|
||||
@@ -2478,7 +2478,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
mService.deferWindowLayout();
|
||||
try {
|
||||
task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE, activityOptions, ON_TOP);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE, activityOptions, ON_TOP);
|
||||
if (task == null) {
|
||||
mWindowManager.executeAppTransition();
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
@@ -75,7 +75,7 @@ import static com.android.server.wm.ActivityTaskManagerService.ANIMATE;
|
||||
import static com.android.server.wm.LaunchParamsController.LaunchParamsModifier.PHASE_BOUNDS;
|
||||
import static com.android.server.wm.LaunchParamsController.LaunchParamsModifier.PHASE_DISPLAY;
|
||||
import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_STACK_TO_FRONT;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_ROOT_TASK_TO_FRONT;
|
||||
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
@@ -2532,8 +2532,8 @@ class ActivityStarter {
|
||||
"bringingFoundTaskToFront");
|
||||
mMovedToFront = !isSplitScreenTopStack;
|
||||
} else {
|
||||
intentTask.reparent(launchStack, ON_TOP, REPARENT_MOVE_STACK_TO_FRONT, ANIMATE,
|
||||
DEFER_RESUME, "reparentToTargetStack");
|
||||
intentTask.reparent(launchStack, ON_TOP, REPARENT_MOVE_ROOT_TASK_TO_FRONT,
|
||||
ANIMATE, DEFER_RESUME, "reparentToTargetStack");
|
||||
mMovedToFront = true;
|
||||
}
|
||||
mOptions = null;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ActivityTaskManagerDebugConfig {
|
||||
|
||||
static final boolean DEBUG_RECENTS = DEBUG_ALL || false;
|
||||
static final boolean DEBUG_RECENTS_TRIM_TASKS = DEBUG_RECENTS || false;
|
||||
static final boolean DEBUG_STACK = DEBUG_ALL || false;
|
||||
static final boolean DEBUG_ROOT_TASK = DEBUG_ALL || false;
|
||||
public static final boolean DEBUG_SWITCH = DEBUG_ALL || false;
|
||||
static final boolean DEBUG_TRANSITION = DEBUG_ALL || false;
|
||||
static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false;
|
||||
@@ -73,7 +73,7 @@ public class ActivityTaskManagerDebugConfig {
|
||||
static final String POSTFIX_PAUSE = APPEND_CATEGORY_NAME ? "_Pause" : "";
|
||||
static final String POSTFIX_RECENTS = APPEND_CATEGORY_NAME ? "_Recents" : "";
|
||||
static final String POSTFIX_SAVED_STATE = APPEND_CATEGORY_NAME ? "_SavedState" : "";
|
||||
static final String POSTFIX_STACK = APPEND_CATEGORY_NAME ? "_Stack" : "";
|
||||
static final String POSTFIX_ROOT_TASK = APPEND_CATEGORY_NAME ? "_RootTask" : "";
|
||||
static final String POSTFIX_STATES = APPEND_CATEGORY_NAME ? "_States" : "";
|
||||
public static final String POSTFIX_SWITCH = APPEND_CATEGORY_NAME ? "_Switch" : "";
|
||||
static final String POSTFIX_TASKS = APPEND_CATEGORY_NAME ? "_Tasks" : "";
|
||||
|
||||
@@ -106,7 +106,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_CONFI
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_FOCUS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_IMMERSIVE;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_LOCKTASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_ROOT_TASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_SWITCH;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_VISIBILITY;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
|
||||
@@ -120,11 +120,11 @@ import static com.android.server.wm.ActivityTaskManagerService.UiHandler.DISMISS
|
||||
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_DONT_LOCK;
|
||||
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
|
||||
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_ONLY;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_ONLY;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.Task.ActivityState.DESTROYED;
|
||||
import static com.android.server.wm.Task.ActivityState.DESTROYING;
|
||||
import static com.android.server.wm.Task.REPARENT_KEEP_STACK_AT_FRONT;
|
||||
import static com.android.server.wm.Task.REPARENT_KEEP_ROOT_TASK_AT_FRONT;
|
||||
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
||||
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
|
||||
|
||||
@@ -306,7 +306,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityTaskManagerService" : TAG_ATM;
|
||||
static final String TAG_STACK = TAG + POSTFIX_STACK;
|
||||
static final String TAG_ROOT_TASK = TAG + POSTFIX_ROOT_TASK;
|
||||
static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
|
||||
private static final String TAG_IMMERSIVE = TAG + POSTFIX_IMMERSIVE;
|
||||
private static final String TAG_FOCUS = TAG + POSTFIX_FOCUS;
|
||||
@@ -2228,7 +2228,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
return;
|
||||
}
|
||||
@@ -2266,7 +2266,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
final long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "removeTask: No task remove with id=" + taskId);
|
||||
return false;
|
||||
@@ -2374,7 +2374,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "getTaskBounds: taskId=" + taskId + " not found");
|
||||
return rect;
|
||||
@@ -2397,7 +2397,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
enforceCallerIsRecentsOrHasPermission(
|
||||
MANAGE_ACTIVITY_TASKS, "getTaskDescription()");
|
||||
final Task tr = mRootWindowContainer.anyTaskForId(id,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (tr != null) {
|
||||
return tr.getTaskDescription();
|
||||
}
|
||||
@@ -2418,7 +2418,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
return setTaskWindowingModeSplitScreen(taskId, windowingMode, toTop);
|
||||
}
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "setTaskWindowingMode: No task for id=" + taskId);
|
||||
return false;
|
||||
@@ -2789,8 +2789,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
throw new IllegalArgumentException("moveTaskToRootTask: Attempt to move task "
|
||||
+ taskId + " to rootTask " + rootTaskId);
|
||||
}
|
||||
task.reparent(rootTask, toTop, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME,
|
||||
"moveTaskToRootTask");
|
||||
task.reparent(rootTask, toTop, REPARENT_KEEP_ROOT_TASK_AT_FRONT, ANIMATE,
|
||||
!DEFER_RESUME, "moveTaskToRootTask");
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
@@ -2834,7 +2834,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
}
|
||||
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "setTaskWindowingModeSplitScreenPrimary: No task for id=" + taskId);
|
||||
return false;
|
||||
@@ -3013,7 +3013,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
return;
|
||||
}
|
||||
@@ -3361,7 +3361,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
public void setTaskResizeable(int taskId, int resizeableMode) {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(
|
||||
taskId, MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "setTaskResizeable: taskId=" + taskId + " not found");
|
||||
return;
|
||||
@@ -3377,7 +3377,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found");
|
||||
return false;
|
||||
@@ -4395,7 +4395,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
final Task task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_ONLY);
|
||||
MATCH_ATTACHED_TASK_ONLY);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "cancelTaskWindowTransition: taskId=" + taskId + " not found");
|
||||
return;
|
||||
@@ -4423,7 +4423,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
final Task task;
|
||||
synchronized (mGlobalLock) {
|
||||
task = mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
Slog.w(TAG, "getTaskSnapshot: taskId=" + taskId + " not found");
|
||||
return null;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.android.server.wm;
|
||||
|
||||
import static com.android.server.wm.ActivityStackSupervisor.REMOVE_FROM_RECENTS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.IAppTask;
|
||||
@@ -79,7 +79,7 @@ class AppTaskImpl extends IAppTask.Stub {
|
||||
final long origId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
Task task = mService.mRootWindowContainer.anyTaskForId(mTaskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class AppTaskImpl extends IAppTask.Stub {
|
||||
IApplicationThread appThread;
|
||||
synchronized (mService.mGlobalLock) {
|
||||
task = mService.mRootWindowContainer.anyTaskForId(mTaskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ class AppTaskImpl extends IAppTask.Stub {
|
||||
final long origId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
Task task = mService.mRootWindowContainer.anyTaskForId(mTaskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
|
||||
if (task == null) {
|
||||
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_A
|
||||
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
|
||||
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
|
||||
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STACK;
|
||||
import static com.android.server.wm.DisplayContentProto.APP_TRANSITION;
|
||||
import static com.android.server.wm.DisplayContentProto.CAN_SHOW_IME;
|
||||
import static com.android.server.wm.DisplayContentProto.CLOSING_APPS;
|
||||
@@ -238,7 +237,6 @@ import java.util.function.Predicate;
|
||||
*/
|
||||
class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.DisplayContentInfo {
|
||||
private static final String TAG = TAG_WITH_CLASS_NAME ? "DisplayContent" : TAG_WM;
|
||||
private static final String TAG_STACK = TAG + POSTFIX_STACK;
|
||||
|
||||
/** The default scaling mode that scales content automatically. */
|
||||
static final int FORCE_SCALING_MODE_AUTO = 0;
|
||||
|
||||
@@ -59,7 +59,7 @@ import static com.android.server.wm.ActivityStackSupervisor.PRESERVE_WINDOWS;
|
||||
import static com.android.server.wm.ActivityStackSupervisor.dumpHistoryList;
|
||||
import static com.android.server.wm.ActivityStackSupervisor.printThisActivity;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RECENTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STATES;
|
||||
@@ -76,9 +76,9 @@ import static com.android.server.wm.Task.ActivityState.PAUSED;
|
||||
import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPING;
|
||||
import static com.android.server.wm.Task.REPARENT_LEAVE_STACK_IN_PLACE;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_STACK_TO_FRONT;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.Task.REPARENT_LEAVE_ROOT_TASK_IN_PLACE;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_ROOT_TASK_TO_FRONT;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
|
||||
@@ -232,20 +232,19 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({
|
||||
MATCH_TASK_IN_STACKS_ONLY,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE
|
||||
MATCH_ATTACHED_TASK_ONLY,
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS,
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE
|
||||
})
|
||||
public @interface AnyTaskForIdMatchTaskMode {
|
||||
}
|
||||
|
||||
// Match only tasks in the current stacks
|
||||
static final int MATCH_TASK_IN_STACKS_ONLY = 0;
|
||||
// Match either tasks in the current stacks, or in the recent tasks if not found in the stacks
|
||||
static final int MATCH_TASK_IN_STACKS_OR_RECENT_TASKS = 1;
|
||||
// Match either tasks in the current stacks, or in the recent tasks, restoring it to the
|
||||
// provided stack id
|
||||
static final int MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE = 2;
|
||||
// Match only tasks that are attached to the hierarchy
|
||||
static final int MATCH_ATTACHED_TASK_ONLY = 0;
|
||||
// Match either attached tasks, or in the recent tasks if the tasks are detached
|
||||
static final int MATCH_ATTACHED_TASK_OR_RECENT_TASKS = 1;
|
||||
// Match either attached tasks, or in the recent tasks, restoring it to the provided task id
|
||||
static final int MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE = 2;
|
||||
|
||||
ActivityTaskManagerService mService;
|
||||
ActivityStackSupervisor mStackSupervisor;
|
||||
@@ -1953,7 +1952,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
|
||||
for (int taskNdx = displayArea.getStackCount() - 1; taskNdx >= 0; --taskNdx) {
|
||||
final Task rootTask = displayArea.getStackAt(taskNdx);
|
||||
if (rootTask.getVisibility(null /*starting*/) == STACK_VISIBILITY_INVISIBLE) {
|
||||
if (rootTask.getVisibility(null /*starting*/) == TASK_VISIBILITY_INVISIBLE) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2556,7 +2555,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
|
||||
@Override
|
||||
public void onDisplayAdded(int displayId) {
|
||||
if (DEBUG_STACK) Slog.v(TAG, "Display added displayId=" + displayId);
|
||||
if (DEBUG_ROOT_TASK) Slog.v(TAG, "Display added displayId=" + displayId);
|
||||
synchronized (mService.mGlobalLock) {
|
||||
final DisplayContent display = getDisplayContentOrCreate(displayId);
|
||||
if (display == null) {
|
||||
@@ -2578,7 +2577,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
|
||||
@Override
|
||||
public void onDisplayRemoved(int displayId) {
|
||||
if (DEBUG_STACK) Slog.v(TAG, "Display removed displayId=" + displayId);
|
||||
if (DEBUG_ROOT_TASK) Slog.v(TAG, "Display removed displayId=" + displayId);
|
||||
if (displayId == DEFAULT_DISPLAY) {
|
||||
throw new IllegalArgumentException("Can't remove the primary display.");
|
||||
}
|
||||
@@ -2595,7 +2594,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
|
||||
@Override
|
||||
public void onDisplayChanged(int displayId) {
|
||||
if (DEBUG_STACK) Slog.v(TAG, "Display changed displayId=" + displayId);
|
||||
if (DEBUG_ROOT_TASK) Slog.v(TAG, "Display changed displayId=" + displayId);
|
||||
synchronized (mService.mGlobalLock) {
|
||||
final DisplayContent displayContent = getDisplayContent(displayId);
|
||||
if (displayContent != null) {
|
||||
@@ -2888,7 +2887,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
// Temporarily set the task id to invalid in case in re-entry.
|
||||
options.setLaunchTaskId(INVALID_TASK_ID);
|
||||
final Task task = anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE, options, onTop);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE, options, onTop);
|
||||
options.setLaunchTaskId(taskId);
|
||||
if (task != null) {
|
||||
return task.getRootTask();
|
||||
@@ -3444,7 +3443,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
}
|
||||
|
||||
Task anyTaskForId(int id) {
|
||||
return anyTaskForId(id, MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE);
|
||||
return anyTaskForId(id, MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE);
|
||||
}
|
||||
|
||||
Task anyTaskForId(int id, @RootWindowContainer.AnyTaskForIdMatchTaskMode int matchMode) {
|
||||
@@ -3462,7 +3461,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
Task anyTaskForId(int id, @RootWindowContainer.AnyTaskForIdMatchTaskMode int matchMode,
|
||||
@Nullable ActivityOptions aOptions, boolean onTop) {
|
||||
// If options are set, ensure that we are attempting to actually restore a task
|
||||
if (matchMode != MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE && aOptions != null) {
|
||||
if (matchMode != MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE && aOptions != null) {
|
||||
throw new IllegalArgumentException("Should not specify activity options for non-restore"
|
||||
+ " lookup");
|
||||
}
|
||||
@@ -3480,7 +3479,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
getLaunchStack(null, aOptions, task, onTop);
|
||||
if (launchStack != null && task.getRootTask() != launchStack) {
|
||||
final int reparentMode = onTop
|
||||
? REPARENT_MOVE_STACK_TO_FRONT : REPARENT_LEAVE_STACK_IN_PLACE;
|
||||
? REPARENT_MOVE_ROOT_TASK_TO_FRONT : REPARENT_LEAVE_ROOT_TASK_IN_PLACE;
|
||||
task.reparent(launchStack, onTop, reparentMode, ANIMATE, DEFER_RESUME,
|
||||
"anyTaskForId");
|
||||
}
|
||||
@@ -3489,7 +3488,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
}
|
||||
|
||||
// If we are matching stack tasks only, return now
|
||||
if (matchMode == MATCH_TASK_IN_STACKS_ONLY) {
|
||||
if (matchMode == MATCH_ATTACHED_TASK_ONLY) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3506,11 +3505,11 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
return null;
|
||||
}
|
||||
|
||||
if (matchMode == MATCH_TASK_IN_STACKS_OR_RECENT_TASKS) {
|
||||
if (matchMode == MATCH_ATTACHED_TASK_OR_RECENT_TASKS) {
|
||||
return task;
|
||||
}
|
||||
|
||||
// Implicitly, this case is MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE
|
||||
// Implicitly, this case is MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE
|
||||
if (!mStackSupervisor.restoreRecentTaskLocked(task, aOptions, onTop)) {
|
||||
if (DEBUG_RECENTS) {
|
||||
Slog.w(TAG_RECENTS,
|
||||
|
||||
@@ -103,7 +103,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_LOCKT
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_PAUSE;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RECENTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RESULTS;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_ROOT_TASK;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STATES;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_SWITCH;
|
||||
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_TASKS;
|
||||
@@ -146,7 +146,7 @@ import static com.android.server.wm.TaskProto.WINDOW_CONTAINER;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
|
||||
import static com.android.server.wm.WindowContainerChildProto.TASK;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ROOT_TASK;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_MOVEMENT;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
import static com.android.server.wm.WindowManagerService.MIN_TASK_LETTERBOX_ASPECT_RATIO;
|
||||
@@ -252,7 +252,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
static final String TAG_CLEANUP = TAG + POSTFIX_CLEANUP;
|
||||
private static final String TAG_PAUSE = TAG + POSTFIX_PAUSE;
|
||||
private static final String TAG_RESULTS = TAG + POSTFIX_RESULTS;
|
||||
private static final String TAG_STACK = TAG + POSTFIX_STACK;
|
||||
private static final String TAG_ROOT_TASK = TAG + POSTFIX_ROOT_TASK;
|
||||
private static final String TAG_STATES = TAG + POSTFIX_STATES;
|
||||
private static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
|
||||
private static final String TAG_TRANSITION = TAG + POSTFIX_TRANSITION;
|
||||
@@ -309,38 +309,37 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
private float mShadowRadius = 0;
|
||||
|
||||
/**
|
||||
* The modes to control how the stack is moved to the front when calling {@link Task#reparent}.
|
||||
* The modes to control how root task is moved to the front when calling {@link Task#reparent}.
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({
|
||||
REPARENT_MOVE_STACK_TO_FRONT,
|
||||
REPARENT_KEEP_STACK_AT_FRONT,
|
||||
REPARENT_LEAVE_STACK_IN_PLACE
|
||||
REPARENT_MOVE_ROOT_TASK_TO_FRONT,
|
||||
REPARENT_KEEP_ROOT_TASK_AT_FRONT,
|
||||
REPARENT_LEAVE_ROOT_TASK_IN_PLACE
|
||||
})
|
||||
@interface ReparentMoveStackMode {}
|
||||
// Moves the stack to the front if it was not at the front
|
||||
static final int REPARENT_MOVE_STACK_TO_FRONT = 0;
|
||||
// Only moves the stack to the front if it was focused or front most already
|
||||
static final int REPARENT_KEEP_STACK_AT_FRONT = 1;
|
||||
// Do not move the stack as a part of reparenting
|
||||
static final int REPARENT_LEAVE_STACK_IN_PLACE = 2;
|
||||
@interface ReparentMoveRootTaskMode {}
|
||||
// Moves the root task to the front if it was not at the front
|
||||
static final int REPARENT_MOVE_ROOT_TASK_TO_FRONT = 0;
|
||||
// Only moves the root task to the front if it was focused or front most already
|
||||
static final int REPARENT_KEEP_ROOT_TASK_AT_FRONT = 1;
|
||||
// Do not move the root task as a part of reparenting
|
||||
static final int REPARENT_LEAVE_ROOT_TASK_IN_PLACE = 2;
|
||||
|
||||
// TODO (b/157876447): switch to Task related name
|
||||
@IntDef(prefix = {"STACK_VISIBILITY"}, value = {
|
||||
STACK_VISIBILITY_VISIBLE,
|
||||
STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
STACK_VISIBILITY_INVISIBLE,
|
||||
@IntDef(prefix = {"TASK_VISIBILITY"}, value = {
|
||||
TASK_VISIBILITY_VISIBLE,
|
||||
TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
TASK_VISIBILITY_INVISIBLE,
|
||||
})
|
||||
@interface StackVisibility {}
|
||||
@interface TaskVisibility {}
|
||||
|
||||
/** Stack is visible. No other stacks on top that fully or partially occlude it. */
|
||||
static final int STACK_VISIBILITY_VISIBLE = 0;
|
||||
/** Task is visible. No other tasks on top that fully or partially occlude it. */
|
||||
static final int TASK_VISIBILITY_VISIBLE = 0;
|
||||
|
||||
/** Stack is partially occluded by other translucent stack(s) on top of it. */
|
||||
static final int STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT = 1;
|
||||
/** Task is partially occluded by other translucent task(s) on top of it. */
|
||||
static final int TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT = 1;
|
||||
|
||||
/** Stack is completely invisible. */
|
||||
static final int STACK_VISIBILITY_INVISIBLE = 2;
|
||||
/** Task is completely invisible. */
|
||||
static final int TASK_VISIBILITY_INVISIBLE = 2;
|
||||
|
||||
enum ActivityState {
|
||||
INITIALIZING,
|
||||
@@ -954,7 +953,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
mAtmService.getLockTaskController().clearLockedTask(this);
|
||||
}
|
||||
if (shouldDeferRemoval()) {
|
||||
if (DEBUG_STACK) Slog.i(TAG, "removeTask: deferring removing taskId=" + mTaskId);
|
||||
if (DEBUG_ROOT_TASK) Slog.i(TAG, "removeTask: deferring removing taskId=" + mTaskId);
|
||||
return;
|
||||
}
|
||||
removeImmediately();
|
||||
@@ -1046,7 +1045,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
/** Convenience method to reparent a task to the top or bottom position of the stack. */
|
||||
boolean reparent(Task preferredStack, boolean toTop,
|
||||
@ReparentMoveStackMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
@ReparentMoveRootTaskMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
String reason) {
|
||||
return reparent(preferredStack, toTop ? MAX_VALUE : 0, moveStackMode, animate, deferResume,
|
||||
true /* schedulePictureInPictureModeChange */, reason);
|
||||
@@ -1057,7 +1056,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
* an option to skip scheduling the picture-in-picture mode change.
|
||||
*/
|
||||
boolean reparent(Task preferredStack, boolean toTop,
|
||||
@ReparentMoveStackMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
@ReparentMoveRootTaskMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
boolean schedulePictureInPictureModeChange, String reason) {
|
||||
return reparent(preferredStack, toTop ? MAX_VALUE : 0, moveStackMode, animate,
|
||||
deferResume, schedulePictureInPictureModeChange, reason);
|
||||
@@ -1065,7 +1064,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
/** Convenience method to reparent a task to a specific position of the stack. */
|
||||
boolean reparent(Task preferredStack, int position,
|
||||
@ReparentMoveStackMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
@ReparentMoveRootTaskMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
String reason) {
|
||||
return reparent(preferredStack, position, moveStackMode, animate, deferResume,
|
||||
true /* schedulePictureInPictureModeChange */, reason);
|
||||
@@ -1091,7 +1090,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
// TODO: Inspect all call sites and change to just changing windowing mode of the stack vs.
|
||||
// re-parenting the task. Can only be done when we are no longer using static stack Ids.
|
||||
boolean reparent(Task preferredStack, int position,
|
||||
@ReparentMoveStackMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
@ReparentMoveRootTaskMode int moveStackMode, boolean animate, boolean deferResume,
|
||||
boolean schedulePictureInPictureModeChange, String reason) {
|
||||
final ActivityStackSupervisor supervisor = mStackSupervisor;
|
||||
final RootWindowContainer root = mRootWindowContainer;
|
||||
@@ -1146,8 +1145,9 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
final boolean wasFront = r != null && sourceStack.isTopStackInDisplayArea()
|
||||
&& (sourceStack.topRunningActivity() == r);
|
||||
|
||||
final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_STACK_TO_FRONT
|
||||
|| (moveStackMode == REPARENT_KEEP_STACK_AT_FRONT && (wasFocused || wasFront));
|
||||
final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_ROOT_TASK_TO_FRONT
|
||||
|| (moveStackMode == REPARENT_KEEP_ROOT_TASK_AT_FRONT
|
||||
&& (wasFocused || wasFront));
|
||||
|
||||
reparent(toStack, position, moveStackToFront, reason);
|
||||
|
||||
@@ -1171,7 +1171,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
toStack.prepareFreezingTaskBounds();
|
||||
|
||||
if (toStackWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
&& moveStackMode == REPARENT_KEEP_STACK_AT_FRONT) {
|
||||
&& moveStackMode == REPARENT_KEEP_ROOT_TASK_AT_FRONT) {
|
||||
// Move recents to front so it is not behind home stack when going into docked
|
||||
// mode
|
||||
mStackSupervisor.moveRecentsStackToFront(reason);
|
||||
@@ -1522,7 +1522,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_STACK) Slog.d(TAG_STACK,
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK) Slog.d(TAG_ROOT_TASK,
|
||||
"setResumedActivity stack:" + this + " + from: "
|
||||
+ mResumedActivity + " to:" + r + " reason:" + reason);
|
||||
mResumedActivity = r;
|
||||
@@ -2175,8 +2175,8 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
}
|
||||
|
||||
if (state == RESUMED) {
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_STACK) {
|
||||
Slog.v(TAG_STACK, "set resumed activity to:" + record + " reason:" + reason);
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK) {
|
||||
Slog.v(TAG_ROOT_TASK, "set resumed activity to:" + record + " reason:" + reason);
|
||||
}
|
||||
setResumedActivity(record, reason + " - onActivityStateChanged");
|
||||
if (record == mRootWindowContainer.getTopResumedActivity()) {
|
||||
@@ -3230,7 +3230,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
@Override
|
||||
void removeImmediately() {
|
||||
if (DEBUG_STACK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId);
|
||||
if (DEBUG_ROOT_TASK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId);
|
||||
EventLogTags.writeWmTaskRemoved(mTaskId, "removeTask");
|
||||
|
||||
// If applicable let the TaskOrganizer know the Task is vanishing.
|
||||
@@ -3241,7 +3241,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
// TODO: Consolidate this with Task.reparent()
|
||||
void reparent(Task stack, int position, boolean moveParents, String reason) {
|
||||
if (DEBUG_STACK) Slog.i(TAG, "reParentTask: removing taskId=" + mTaskId
|
||||
if (DEBUG_ROOT_TASK) Slog.i(TAG, "reParentTask: removing taskId=" + mTaskId
|
||||
+ " from stack=" + getRootTask());
|
||||
EventLogTags.writeWmTaskRemoved(mTaskId, "reParentTask:" + reason);
|
||||
|
||||
@@ -4145,7 +4145,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
* @param starting The currently starting activity or null if there is none.
|
||||
*/
|
||||
boolean shouldBeVisible(ActivityRecord starting) {
|
||||
return getVisibility(starting) != STACK_VISIBILITY_INVISIBLE;
|
||||
return getVisibility(starting) != TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4153,14 +4153,14 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
*
|
||||
* @param starting The currently starting activity or null if there is none.
|
||||
*/
|
||||
@Task.StackVisibility
|
||||
@TaskVisibility
|
||||
int getVisibility(ActivityRecord starting) {
|
||||
if (!isAttached() || isForceHidden()) {
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
|
||||
if (isTopActivityLaunchedBehind()) {
|
||||
return STACK_VISIBILITY_VISIBLE;
|
||||
return TASK_VISIBILITY_VISIBLE;
|
||||
}
|
||||
|
||||
boolean gotSplitScreenStack = false;
|
||||
@@ -4176,10 +4176,10 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
final WindowContainer parent = getParent();
|
||||
if (parent.asTask() != null) {
|
||||
final int parentVisibility = parent.asTask().getVisibility(starting);
|
||||
if (parentVisibility == STACK_VISIBILITY_INVISIBLE) {
|
||||
if (parentVisibility == TASK_VISIBILITY_INVISIBLE) {
|
||||
// Can't be visible if parent isn't visible
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
} else if (parentVisibility == STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT) {
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
} else if (parentVisibility == TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT) {
|
||||
// Parent is behind a translucent container so the highest visibility this container
|
||||
// can get is that.
|
||||
gotTranslucentFullscreen = true;
|
||||
@@ -4214,7 +4214,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
gotTranslucentFullscreen = true;
|
||||
continue;
|
||||
}
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
} else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
&& !gotOpaqueSplitScreenPrimary) {
|
||||
gotSplitScreenStack = true;
|
||||
@@ -4223,7 +4223,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
&& gotOpaqueSplitScreenPrimary) {
|
||||
// Can not be visible behind another opaque stack in split-screen-primary mode.
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
} else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
|
||||
&& !gotOpaqueSplitScreenSecondary) {
|
||||
@@ -4233,24 +4233,24 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
|
||||
&& gotOpaqueSplitScreenSecondary) {
|
||||
// Can not be visible behind another opaque stack in split-screen-secondary mode.
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
}
|
||||
if (gotOpaqueSplitScreenPrimary && gotOpaqueSplitScreenSecondary) {
|
||||
// Can not be visible if we are in split-screen windowing mode and both halves of
|
||||
// the screen are opaque.
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
if (isAssistantType && gotSplitScreenStack) {
|
||||
// Assistant stack can't be visible behind split-screen. In addition to this not
|
||||
// making sense, it also works around an issue here we boost the z-order of the
|
||||
// assistant window surfaces in window manager whenever it is visible.
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shouldBeVisible) {
|
||||
return STACK_VISIBILITY_INVISIBLE;
|
||||
return TASK_VISIBILITY_INVISIBLE;
|
||||
}
|
||||
|
||||
// Handle cases when there can be a translucent split-screen stack on top.
|
||||
@@ -4258,26 +4258,26 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
case WINDOWING_MODE_FULLSCREEN:
|
||||
if (gotTranslucentSplitScreenPrimary || gotTranslucentSplitScreenSecondary) {
|
||||
// At least one of the split-screen stacks that covers this one is translucent.
|
||||
return STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
return TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
}
|
||||
break;
|
||||
case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY:
|
||||
if (gotTranslucentSplitScreenPrimary) {
|
||||
// Covered by translucent primary split-screen on top.
|
||||
return STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
return TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
}
|
||||
break;
|
||||
case WINDOWING_MODE_SPLIT_SCREEN_SECONDARY:
|
||||
if (gotTranslucentSplitScreenSecondary) {
|
||||
// Covered by translucent secondary split-screen on top.
|
||||
return STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
return TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Lastly - check if there is a translucent fullscreen stack on top.
|
||||
return gotTranslucentFullscreen ? STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT
|
||||
: STACK_VISIBILITY_VISIBLE;
|
||||
return gotTranslucentFullscreen ? TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT
|
||||
: TASK_VISIBILITY_VISIBLE;
|
||||
}
|
||||
|
||||
private boolean isTopActivityLaunchedBehind() {
|
||||
@@ -7291,7 +7291,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
boolean toTop = position >= getChildCount();
|
||||
boolean includingParents = toTop || getDisplayArea().getNextFocusableStack(this,
|
||||
true /* ignoreCurrent */) == null;
|
||||
if (WindowManagerDebugConfig.DEBUG_STACK) {
|
||||
if (WindowManagerDebugConfig.DEBUG_ROOT_TASK) {
|
||||
Slog.i(TAG_WM, "positionChildAt: positioning task=" + task + " at " + position);
|
||||
}
|
||||
positionChildAt(position, task, includingParents);
|
||||
|
||||
@@ -37,11 +37,11 @@ import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_STATES;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_TASKS;
|
||||
import static com.android.server.wm.ActivityTaskManagerService.TAG_STACK;
|
||||
import static com.android.server.wm.ActivityTaskManagerService.TAG_ROOT_TASK;
|
||||
import static com.android.server.wm.DisplayContent.alwaysCreateStack;
|
||||
import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ROOT_TASK;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
@@ -311,7 +311,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
|
||||
|
||||
@Override
|
||||
void addChild(Task task, int position) {
|
||||
if (DEBUG_STACK) Slog.d(TAG_WM, "Set task=" + task + " on taskDisplayArea=" + this);
|
||||
if (DEBUG_ROOT_TASK) Slog.d(TAG_WM, "Set task=" + task + " on taskDisplayArea=" + this);
|
||||
|
||||
addStackReferenceIfNeeded(task);
|
||||
position = findPositionForStack(position, task, true /* adding */);
|
||||
@@ -831,8 +831,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
|
||||
}
|
||||
|
||||
void onStackRemoved(Task stack) {
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_STACK) {
|
||||
Slog.v(TAG_STACK, "removeStack: detaching " + stack + " from displayId="
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK) {
|
||||
Slog.v(TAG_ROOT_TASK, "removeStack: detaching " + stack + " from displayId="
|
||||
+ mDisplayContent.mDisplayId);
|
||||
}
|
||||
if (mPreferredTopFocusableStack == stack) {
|
||||
@@ -870,7 +870,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
|
||||
homeParentTask.positionChildAtBottom(task);
|
||||
} else {
|
||||
task.reparent(homeParentTask, false /* toTop */,
|
||||
Task.REPARENT_LEAVE_STACK_IN_PLACE, false /* animate */,
|
||||
Task.REPARENT_LEAVE_ROOT_TASK_IN_PLACE, false /* animate */,
|
||||
false /* deferResume */, "positionTaskBehindHome");
|
||||
}
|
||||
}
|
||||
@@ -1205,8 +1205,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
|
||||
}
|
||||
}
|
||||
final Task currentFocusedStack = getFocusedStack();
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_STACK) {
|
||||
Slog.d(TAG_STACK, "allResumedActivitiesComplete: mLastFocusedStack changing from="
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK) {
|
||||
Slog.d(TAG_ROOT_TASK, "allResumedActivitiesComplete: mLastFocusedStack changing from="
|
||||
+ mLastFocusedStack + " to=" + currentFocusedStack);
|
||||
}
|
||||
mLastFocusedStack = currentFocusedStack;
|
||||
@@ -1230,7 +1230,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
|
||||
final Task stack = getStackAt(stackNdx);
|
||||
final ActivityRecord resumedActivity = stack.getResumedActivity();
|
||||
if (resumedActivity != null
|
||||
&& (stack.getVisibility(resuming) != STACK_VISIBILITY_VISIBLE
|
||||
&& (stack.getVisibility(resuming) != TASK_VISIBILITY_VISIBLE
|
||||
|| !stack.isTopActivityFocusable())) {
|
||||
ProtoLog.d(WM_DEBUG_STATES, "pauseBackStacks: stack=%s "
|
||||
+ "mResumedActivity=%s", stack, resumedActivity);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.server.wm;
|
||||
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -330,7 +330,7 @@ public class TaskPersister implements PersisterQueue.Listener {
|
||||
|
||||
final int taskId = task.mTaskId;
|
||||
if (mService.mRootWindowContainer.anyTaskForId(taskId,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS) != null) {
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) {
|
||||
// Should not happen.
|
||||
Slog.wtf(TAG, "Existing task with taskId " + taskId + "found");
|
||||
} else if (userId != task.mUserId) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class WindowManagerDebugConfig {
|
||||
static final boolean DEBUG_WINDOW_TRACE = false;
|
||||
static final boolean DEBUG_TASK_MOVEMENT = false;
|
||||
static final boolean DEBUG_TASK_POSITIONING = false;
|
||||
static final boolean DEBUG_STACK = false;
|
||||
static final boolean DEBUG_ROOT_TASK = false;
|
||||
static final boolean DEBUG_DISPLAY = false;
|
||||
static final boolean DEBUG_POWER = false;
|
||||
static final boolean SHOW_VERBOSE_TRANSACTIONS = false;
|
||||
|
||||
@@ -59,9 +59,9 @@ import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.ActivityState.STARTED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPING;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@@ -516,13 +516,13 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
mActivity.setState(Task.ActivityState.STOPPED, "Testing");
|
||||
spyOn(mStack);
|
||||
|
||||
doReturn(STACK_VISIBILITY_VISIBLE).when(mStack).getVisibility(null);
|
||||
doReturn(TASK_VISIBILITY_VISIBLE).when(mStack).getVisibility(null);
|
||||
assertEquals(true, mActivity.shouldResumeActivity(null /* activeActivity */));
|
||||
|
||||
doReturn(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT).when(mStack).getVisibility(null);
|
||||
doReturn(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT).when(mStack).getVisibility(null);
|
||||
assertEquals(false, mActivity.shouldResumeActivity(null /* activeActivity */));
|
||||
|
||||
doReturn(STACK_VISIBILITY_INVISIBLE).when(mStack).getVisibility(null);
|
||||
doReturn(TASK_VISIBILITY_INVISIBLE).when(mStack).getVisibility(null);
|
||||
assertEquals(false, mActivity.shouldResumeActivity(null /* activeActivity */));
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
mActivity.addResultLocked(topActivity, "resultWho", 0, 0, new Intent());
|
||||
topActivity.finishing = true;
|
||||
|
||||
doReturn(STACK_VISIBILITY_VISIBLE).when(mStack).getVisibility(null);
|
||||
doReturn(TASK_VISIBILITY_VISIBLE).when(mStack).getVisibility(null);
|
||||
assertEquals(true, mActivity.shouldResumeActivity(null /* activeActivity */));
|
||||
assertEquals(false, mActivity.shouldPauseActivity(null /*activeActivity */));
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ import static com.android.server.wm.Task.ActivityState.RESUMED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPED;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPING;
|
||||
import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_TASK_ORG;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_STACK_TO_FRONT;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.Task.STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
import static com.android.server.wm.Task.REPARENT_MOVE_ROOT_TASK_TO_FRONT;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_INVISIBLE;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
|
||||
import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
|
||||
import static com.android.server.wm.TaskDisplayArea.getStackAbove;
|
||||
import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
|
||||
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
||||
@@ -123,7 +123,7 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
final Task destStack = mDefaultTaskDisplayArea.createStack(
|
||||
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */);
|
||||
|
||||
mTask.reparent(destStack, true /* toTop */, Task.REPARENT_KEEP_STACK_AT_FRONT,
|
||||
mTask.reparent(destStack, true /* toTop */, Task.REPARENT_KEEP_ROOT_TASK_AT_FRONT,
|
||||
false /* animate */, true /* deferResume*/,
|
||||
"testResumedActivityFromTaskReparenting");
|
||||
|
||||
@@ -140,7 +140,7 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
|
||||
final Task destStack = mDefaultTaskDisplayArea.createStack(
|
||||
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */);
|
||||
mTask.reparent(destStack, true /*toTop*/, REPARENT_MOVE_STACK_TO_FRONT, false, false,
|
||||
mTask.reparent(destStack, true /*toTop*/, REPARENT_MOVE_ROOT_TASK_TO_FRONT, false, false,
|
||||
"testResumedActivityFromActivityReparenting");
|
||||
|
||||
assertNull(mStack.getResumedActivity());
|
||||
@@ -418,10 +418,10 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
assertFalse(homeStack.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
|
||||
// Home stack should be visible if one of the halves of split-screen is translucent.
|
||||
@@ -429,11 +429,11 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
assertTrue(homeStack.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
homeStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
|
||||
final Task splitScreenSecondary2 =
|
||||
@@ -444,9 +444,9 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
doReturn(false).when(splitScreenSecondary2).isTranslucent(any());
|
||||
assertFalse(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
|
||||
// First split-screen secondary should be visible behind another translucent split-screen
|
||||
@@ -454,9 +454,9 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
doReturn(true).when(splitScreenSecondary2).isTranslucent(any());
|
||||
assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
|
||||
final Task assistantStack = createStackForShouldBeVisibleTest(
|
||||
@@ -469,13 +469,13 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
assertFalse(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertFalse(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertFalse(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
assistantStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
|
||||
// Split-screen stacks should be visible behind a translucent fullscreen stack.
|
||||
@@ -484,13 +484,13 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
assistantStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
|
||||
// Assistant stack shouldn't be visible behind translucent split-screen stack,
|
||||
@@ -505,25 +505,25 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
assertTrue(assistantStack.shouldBeVisible(null /* starting */));
|
||||
assertFalse(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertFalse(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
assistantStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
} else {
|
||||
assertFalse(assistantStack.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */));
|
||||
assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
assistantStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
splitScreenSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
splitScreenSecondary2.getVisibility(null /* starting */));
|
||||
}
|
||||
}
|
||||
@@ -548,33 +548,33 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
// Re-parent home to split secondary.
|
||||
homeStack.reparent(splitSecondary, POSITION_TOP);
|
||||
// Current tasks should be visible.
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, splitPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, splitSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, splitPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, splitSecondary.getVisibility(null /* starting */));
|
||||
// Home task should still be visible even though it is a child of another visible task.
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
|
||||
|
||||
// Add fullscreen translucent task that partially occludes split tasks
|
||||
final Task translucentStack = createStandardStackForVisibilityTest(
|
||||
WINDOWING_MODE_FULLSCREEN, true /* translucent */);
|
||||
// Fullscreen translucent task should be visible
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, translucentStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, translucentStack.getVisibility(null /* starting */));
|
||||
// Split tasks should be visible behind translucent
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitPrimary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
splitSecondary.getVisibility(null /* starting */));
|
||||
// Home task should be visible behind translucent since its parent is visible behind
|
||||
// translucent.
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
homeStack.getVisibility(null /* starting */));
|
||||
|
||||
|
||||
// Hide split-secondary
|
||||
splitSecondary.setForceHidden(FLAG_FORCE_HIDDEN_FOR_TASK_ORG, true /* set */);
|
||||
// Home split secondary and home task should be invisible.
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE, splitSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE, splitSecondary.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE, homeStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -586,9 +586,9 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
createStandardStackForVisibilityTest(WINDOWING_MODE_FULLSCREEN,
|
||||
true /* translucent */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
translucentStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@@ -604,10 +604,10 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
createStandardStackForVisibilityTest(WINDOWING_MODE_FULLSCREEN,
|
||||
false /* translucent */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE, bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE, bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
translucentStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, opaqueStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, opaqueStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -622,10 +622,10 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
createStandardStackForVisibilityTest(WINDOWING_MODE_FULLSCREEN,
|
||||
true /* translucent */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE, bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE, bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
opaqueStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
translucentStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@@ -638,9 +638,9 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
createStandardStackForVisibilityTest(WINDOWING_MODE_FULLSCREEN,
|
||||
true /* translucent */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
bottomTranslucentStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
translucentStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@@ -653,9 +653,9 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
createStandardStackForVisibilityTest(WINDOWING_MODE_FULLSCREEN,
|
||||
false /* translucent */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_INVISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_INVISIBLE,
|
||||
bottomTranslucentStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, opaqueStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, opaqueStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -669,15 +669,15 @@ public class ActivityStackTests extends WindowTestsBase {
|
||||
final Task pinnedStack = createStackForShouldBeVisibleTest(mDefaultTaskDisplayArea,
|
||||
WINDOWING_MODE_PINNED, ACTIVITY_TYPE_STANDARD, true /* onTop */);
|
||||
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT,
|
||||
bottomStack.getVisibility(null /* starting */));
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE,
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE,
|
||||
translucentStack.getVisibility(null /* starting */));
|
||||
// Add an activity to the pinned stack so it isn't considered empty for visibility check.
|
||||
final ActivityRecord pinnedActivity = new ActivityBuilder(mAtm)
|
||||
.setTask(pinnedStack)
|
||||
.build();
|
||||
assertEquals(STACK_VISIBILITY_VISIBLE, pinnedStack.getVisibility(null /* starting */));
|
||||
assertEquals(TASK_VISIBILITY_VISIBLE, pinnedStack.getVisibility(null /* starting */));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,7 +38,7 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
|
||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.times;
|
||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
|
||||
import static com.android.server.wm.ActivityStackSupervisor.ON_TOP;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE;
|
||||
import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE;
|
||||
import static com.android.server.wm.Task.ActivityState.STOPPED;
|
||||
import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
|
||||
|
||||
@@ -107,7 +107,7 @@ public class RootActivityContainerTests extends WindowTestsBase {
|
||||
public void testRestoringInvalidTask() {
|
||||
mRootWindowContainer.getDefaultDisplay().removeAllTasks();
|
||||
Task task = mRootWindowContainer.anyTaskForId(0 /*taskId*/,
|
||||
MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE, null, false /* onTop */);
|
||||
MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE, null, false /* onTop */);
|
||||
assertNull(task);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user