Loading services/core/java/com/android/server/am/TaskRecord.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -617,15 +617,15 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta boolean kept = true; boolean kept = true; try { try { final ActivityRecord r = topRunningActivityLocked(); final ActivityRecord r = topRunningActivityLocked(); final boolean wasFocused = supervisor.isFocusedStack(sourceStack) final boolean wasFocused = r != null && supervisor.isFocusedStack(sourceStack) && (topRunningActivityLocked() == r); && (topRunningActivityLocked() == r); final boolean wasResumed = sourceStack.mResumedActivity == r; final boolean wasResumed = r != null && sourceStack.mResumedActivity == r; final boolean wasPaused = sourceStack.mPausingActivity == r; final boolean wasPaused = r != null && sourceStack.mPausingActivity == r; // In some cases the focused stack isn't the front stack. E.g. pinned stack. // In some cases the focused stack isn't the front stack. E.g. pinned stack. // Whenever we are moving the top activity from the front stack we want to make sure to // Whenever we are moving the top activity from the front stack we want to make sure to // move the stack to the front. // move the stack to the front. final boolean wasFront = supervisor.isFrontStackOnDisplay(sourceStack) final boolean wasFront = r != null && supervisor.isFrontStackOnDisplay(sourceStack) && (sourceStack.topRunningActivityLocked() == r); && (sourceStack.topRunningActivityLocked() == r); // Adjust the position for the new parent stack as needed. // Adjust the position for the new parent stack as needed. Loading Loading @@ -667,8 +667,10 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta // new stack by moving the stack to the front. // new stack by moving the stack to the front. final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_STACK_TO_FRONT final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_STACK_TO_FRONT || (moveStackMode == REPARENT_KEEP_STACK_AT_FRONT && (wasFocused || wasFront)); || (moveStackMode == REPARENT_KEEP_STACK_AT_FRONT && (wasFocused || wasFront)); toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed, wasPaused, if (r != null) { reason); toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed, wasPaused, reason); } if (!animate) { if (!animate) { toStack.mNoAnimActivities.add(topActivity); toStack.mNoAnimActivities.add(topActivity); } } Loading Loading
services/core/java/com/android/server/am/TaskRecord.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -617,15 +617,15 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta boolean kept = true; boolean kept = true; try { try { final ActivityRecord r = topRunningActivityLocked(); final ActivityRecord r = topRunningActivityLocked(); final boolean wasFocused = supervisor.isFocusedStack(sourceStack) final boolean wasFocused = r != null && supervisor.isFocusedStack(sourceStack) && (topRunningActivityLocked() == r); && (topRunningActivityLocked() == r); final boolean wasResumed = sourceStack.mResumedActivity == r; final boolean wasResumed = r != null && sourceStack.mResumedActivity == r; final boolean wasPaused = sourceStack.mPausingActivity == r; final boolean wasPaused = r != null && sourceStack.mPausingActivity == r; // In some cases the focused stack isn't the front stack. E.g. pinned stack. // In some cases the focused stack isn't the front stack. E.g. pinned stack. // Whenever we are moving the top activity from the front stack we want to make sure to // Whenever we are moving the top activity from the front stack we want to make sure to // move the stack to the front. // move the stack to the front. final boolean wasFront = supervisor.isFrontStackOnDisplay(sourceStack) final boolean wasFront = r != null && supervisor.isFrontStackOnDisplay(sourceStack) && (sourceStack.topRunningActivityLocked() == r); && (sourceStack.topRunningActivityLocked() == r); // Adjust the position for the new parent stack as needed. // Adjust the position for the new parent stack as needed. Loading Loading @@ -667,8 +667,10 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta // new stack by moving the stack to the front. // new stack by moving the stack to the front. final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_STACK_TO_FRONT final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_STACK_TO_FRONT || (moveStackMode == REPARENT_KEEP_STACK_AT_FRONT && (wasFocused || wasFront)); || (moveStackMode == REPARENT_KEEP_STACK_AT_FRONT && (wasFocused || wasFront)); toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed, wasPaused, if (r != null) { reason); toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed, wasPaused, reason); } if (!animate) { if (!animate) { toStack.mNoAnimActivities.add(topActivity); toStack.mNoAnimActivities.add(topActivity); } } Loading