Loading services/core/java/com/android/server/wm/ActivityRecord.java +0 −8 Original line number Diff line number Diff line Loading @@ -1212,14 +1212,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return task; } /** * Sets the Task on this activity for the purposes of re-use during launch where we will * re-use another activity instead of this one for the launch. */ void setTaskForReuse(Task task) { this.task = task; } Task getStack() { return task != null ? task.getRootTask() : null; } Loading services/core/java/com/android/server/wm/ActivityStarter.java +4 −17 Original line number Diff line number Diff line Loading @@ -1766,8 +1766,8 @@ class ActivityStarter { } else if (mInTask != null) { return mInTask; } else { final Task stack = getLaunchStack(mStartActivity, mLaunchFlags, null /* task */, mOptions); final Task stack = getLaunchStack(mStartActivity, mLaunchFlags, null /* task */, mOptions); final ActivityRecord top = stack.getTopNonFinishingActivity(); if (top != null) { return top.getTask(); Loading Loading @@ -1870,13 +1870,7 @@ class ActivityStarter { return START_SUCCESS; } boolean clearTaskForReuse = false; if (reusedTask != null) { if (mStartActivity.getTask() == null) { mStartActivity.setTaskForReuse(reusedTask); clearTaskForReuse = true; } if (targetTask.intent == null) { // This task was started because of movement of the activity based on // affinity... Loading Loading @@ -1923,13 +1917,6 @@ class ActivityStarter { complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopNonFinishingActivity() : null, intentGrants); if (clearTaskForReuse) { // Clear task for re-use so later code to methods // {@link #setTaskFromReuseOrCreateNewTask}, {@link #setTaskFromSourceRecord}, or // {@link #setTaskFromInTask} can parent it to the task. mStartActivity.setTaskForReuse(null); } if (mAddingToTask) { return START_SUCCESS; } Loading Loading @@ -2515,8 +2502,8 @@ class ActivityStarter { intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask()); } final Task launchStack = getLaunchStack(mStartActivity, mLaunchFlags, intentTask, mOptions); final Task launchStack = getLaunchStack(mStartActivity, mLaunchFlags, intentTask, mOptions); if (launchStack == null || launchStack == mTargetStack) { // Do not set mMovedToFront to true below for split-screen-top stack, or // START_TASK_TO_FRONT will be returned and trigger unexpected animations when a Loading services/core/java/com/android/server/wm/RootWindowContainer.java +2 −5 Original line number Diff line number Diff line Loading @@ -2816,7 +2816,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent> * @param launchParams The resolved launch params to use. * @param realCallingPid The pid from {@link ActivityStarter#setRealCallingPid} * @param realCallingUid The uid from {@link ActivityStarter#setRealCallingUid} * * @return The stack to use for the launch or INVALID_STACK_ID. */ Task getLaunchStack(@Nullable ActivityRecord r, Loading Loading @@ -2965,10 +2964,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent> // If {@code r} is already in target display area and its task is the same as the candidate // task, the intention should be getting a launch stack for the reusable activity, so we can // use the existing stack. if (candidateTask != null && (r.getTask() == null || r.getTask() == candidateTask)) { // TODO(b/153920825): Fix incorrect evaluation of attached state final TaskDisplayArea attachedTaskDisplayArea = r.getTask() != null ? r.getTask().getDisplayArea() : r.getDisplayArea(); if (candidateTask != null) { final TaskDisplayArea attachedTaskDisplayArea = candidateTask.getDisplayArea(); if (attachedTaskDisplayArea == null || attachedTaskDisplayArea == taskDisplayArea) { return candidateTask.getRootTask(); } Loading services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -890,8 +890,8 @@ public class RootActivityContainerTests extends WindowTestsBase { // Make sure the root task is valid and can be reused on default display. final Task stack = mRootWindowContainer.getValidLaunchStackInTaskDisplayArea( mRootWindowContainer.getDefaultTaskDisplayArea(), activity, task, null, null); mRootWindowContainer.getDefaultTaskDisplayArea(), activity, task, null /* options */, null /* launchParams */); assertEquals(task, stack); } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +0 −8 Original line number Diff line number Diff line Loading @@ -1212,14 +1212,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return task; } /** * Sets the Task on this activity for the purposes of re-use during launch where we will * re-use another activity instead of this one for the launch. */ void setTaskForReuse(Task task) { this.task = task; } Task getStack() { return task != null ? task.getRootTask() : null; } Loading
services/core/java/com/android/server/wm/ActivityStarter.java +4 −17 Original line number Diff line number Diff line Loading @@ -1766,8 +1766,8 @@ class ActivityStarter { } else if (mInTask != null) { return mInTask; } else { final Task stack = getLaunchStack(mStartActivity, mLaunchFlags, null /* task */, mOptions); final Task stack = getLaunchStack(mStartActivity, mLaunchFlags, null /* task */, mOptions); final ActivityRecord top = stack.getTopNonFinishingActivity(); if (top != null) { return top.getTask(); Loading Loading @@ -1870,13 +1870,7 @@ class ActivityStarter { return START_SUCCESS; } boolean clearTaskForReuse = false; if (reusedTask != null) { if (mStartActivity.getTask() == null) { mStartActivity.setTaskForReuse(reusedTask); clearTaskForReuse = true; } if (targetTask.intent == null) { // This task was started because of movement of the activity based on // affinity... Loading Loading @@ -1923,13 +1917,6 @@ class ActivityStarter { complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopNonFinishingActivity() : null, intentGrants); if (clearTaskForReuse) { // Clear task for re-use so later code to methods // {@link #setTaskFromReuseOrCreateNewTask}, {@link #setTaskFromSourceRecord}, or // {@link #setTaskFromInTask} can parent it to the task. mStartActivity.setTaskForReuse(null); } if (mAddingToTask) { return START_SUCCESS; } Loading Loading @@ -2515,8 +2502,8 @@ class ActivityStarter { intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask()); } final Task launchStack = getLaunchStack(mStartActivity, mLaunchFlags, intentTask, mOptions); final Task launchStack = getLaunchStack(mStartActivity, mLaunchFlags, intentTask, mOptions); if (launchStack == null || launchStack == mTargetStack) { // Do not set mMovedToFront to true below for split-screen-top stack, or // START_TASK_TO_FRONT will be returned and trigger unexpected animations when a Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +2 −5 Original line number Diff line number Diff line Loading @@ -2816,7 +2816,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent> * @param launchParams The resolved launch params to use. * @param realCallingPid The pid from {@link ActivityStarter#setRealCallingPid} * @param realCallingUid The uid from {@link ActivityStarter#setRealCallingUid} * * @return The stack to use for the launch or INVALID_STACK_ID. */ Task getLaunchStack(@Nullable ActivityRecord r, Loading Loading @@ -2965,10 +2964,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent> // If {@code r} is already in target display area and its task is the same as the candidate // task, the intention should be getting a launch stack for the reusable activity, so we can // use the existing stack. if (candidateTask != null && (r.getTask() == null || r.getTask() == candidateTask)) { // TODO(b/153920825): Fix incorrect evaluation of attached state final TaskDisplayArea attachedTaskDisplayArea = r.getTask() != null ? r.getTask().getDisplayArea() : r.getDisplayArea(); if (candidateTask != null) { final TaskDisplayArea attachedTaskDisplayArea = candidateTask.getDisplayArea(); if (attachedTaskDisplayArea == null || attachedTaskDisplayArea == taskDisplayArea) { return candidateTask.getRootTask(); } Loading
services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -890,8 +890,8 @@ public class RootActivityContainerTests extends WindowTestsBase { // Make sure the root task is valid and can be reused on default display. final Task stack = mRootWindowContainer.getValidLaunchStackInTaskDisplayArea( mRootWindowContainer.getDefaultTaskDisplayArea(), activity, task, null, null); mRootWindowContainer.getDefaultTaskDisplayArea(), activity, task, null /* options */, null /* launchParams */); assertEquals(task, stack); } Loading