Loading services/core/java/com/android/server/am/ActivityManagerService.java +20 −5 Original line number Diff line number Diff line Loading @@ -4183,14 +4183,16 @@ public final class ActivityManagerService extends ActivityManagerNative "startActivityFromRecentsInner: Task " + taskId + " not found."); } if (launchStackId != INVALID_STACK_ID && task.stack.mStackId != launchStackId) { if (launchStackId != INVALID_STACK_ID) { if (launchStackId == DOCKED_STACK_ID && bOptions != null) { ActivityOptions activityOptions = new ActivityOptions(bOptions); mWindowManager.setDockedStackCreateMode(activityOptions.getDockCreateMode()); } if (task.stack.mStackId != launchStackId) { mStackSupervisor.moveTaskToStackLocked( taskId, launchStackId, ON_TOP, FORCE_FOCUS, "startActivityFromRecents"); } } if (task.getRootActivity() != null) { moveTaskToFrontLocked(task.taskId, 0, bOptions); Loading Loading @@ -8690,12 +8692,25 @@ public final class ActivityManagerService extends ActivityManagerNative Rect rect = new Rect(); try { synchronized (this) { TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); final TaskRecord task = mStackSupervisor.anyTaskForIdLocked( taskId, !RESTORE_FROM_RECENTS, INVALID_STACK_ID); if (task == null) { Slog.w(TAG, "getTaskBounds: taskId=" + taskId + " not found"); return rect; } if (task.stack != null) { // Return the bounds from window manager since it will be adjusted for various // things like the presense of a docked stack for tasks that aren't resizeable. mWindowManager.getTaskBounds(task.taskId, rect); } else { // Task isn't in window manager yet since it isn't associated with a stack. // Return the persist value from activity manager if (task.mBounds != null) { rect.set(task.mBounds); } else if (task.mLastNonFullscreenBounds != null) { rect.set(task.mLastNonFullscreenBounds); } } } } finally { Binder.restoreCallingIdentity(ident); Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −4 Original line number Diff line number Diff line Loading @@ -3272,7 +3272,7 @@ public final class ActivityStackSupervisor implements DisplayListener { task.stack.removeTask(task, "restoreRecentTaskLocked", MOVING); } ActivityStack stack = final ActivityStack stack = getStack(stackId, CREATE_IF_NEEDED, !ON_TOP); if (stack == null) { Loading Loading @@ -3339,15 +3339,16 @@ public final class ActivityStackSupervisor implements DisplayListener { Slog.w(TAG, "moveTaskToStack: no task for id=" + taskId); return; } if (StackId.preserveWindowOnTaskMove(stackId)) { final ActivityRecord topActivity = task.getTopActivity(); if (StackId.preserveWindowOnTaskMove(stackId) && topActivity != null) { // We are about to relaunch the activity because its configuration changed due to // being maximized, i.e. size change. The activity will first remove the old window // and then add a new one. This call will tell window manager about this, so it can // preserve the old window until the new one is drawn. This prevents having a gap // between the removal and addition, in which no window is visible. We also want the // entrance of the new window to be properly animated. ActivityRecord r = task.getTopActivity(); mWindowManager.setReplacingWindow(r.appToken, true /* animate */); mWindowManager.setReplacingWindow(topActivity.appToken, true /* animate */); } final ActivityStack stack = moveTaskToStackUncheckedLocked(task, stackId, toTop, forceFocus, Loading services/core/java/com/android/server/am/TaskRecord.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.am; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT; import static android.content.Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS; import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS; Loading Loading @@ -1366,6 +1367,8 @@ final class TaskRecord { sb.append(stringName); sb.append(" U="); sb.append(userId); sb.append(" StackId="); sb.append(stack != null ? stack.mStackId : INVALID_STACK_ID); sb.append(" sz="); sb.append(mActivities.size()); sb.append('}'); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +20 −5 Original line number Diff line number Diff line Loading @@ -4183,14 +4183,16 @@ public final class ActivityManagerService extends ActivityManagerNative "startActivityFromRecentsInner: Task " + taskId + " not found."); } if (launchStackId != INVALID_STACK_ID && task.stack.mStackId != launchStackId) { if (launchStackId != INVALID_STACK_ID) { if (launchStackId == DOCKED_STACK_ID && bOptions != null) { ActivityOptions activityOptions = new ActivityOptions(bOptions); mWindowManager.setDockedStackCreateMode(activityOptions.getDockCreateMode()); } if (task.stack.mStackId != launchStackId) { mStackSupervisor.moveTaskToStackLocked( taskId, launchStackId, ON_TOP, FORCE_FOCUS, "startActivityFromRecents"); } } if (task.getRootActivity() != null) { moveTaskToFrontLocked(task.taskId, 0, bOptions); Loading Loading @@ -8690,12 +8692,25 @@ public final class ActivityManagerService extends ActivityManagerNative Rect rect = new Rect(); try { synchronized (this) { TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); final TaskRecord task = mStackSupervisor.anyTaskForIdLocked( taskId, !RESTORE_FROM_RECENTS, INVALID_STACK_ID); if (task == null) { Slog.w(TAG, "getTaskBounds: taskId=" + taskId + " not found"); return rect; } if (task.stack != null) { // Return the bounds from window manager since it will be adjusted for various // things like the presense of a docked stack for tasks that aren't resizeable. mWindowManager.getTaskBounds(task.taskId, rect); } else { // Task isn't in window manager yet since it isn't associated with a stack. // Return the persist value from activity manager if (task.mBounds != null) { rect.set(task.mBounds); } else if (task.mLastNonFullscreenBounds != null) { rect.set(task.mLastNonFullscreenBounds); } } } } finally { Binder.restoreCallingIdentity(ident); Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −4 Original line number Diff line number Diff line Loading @@ -3272,7 +3272,7 @@ public final class ActivityStackSupervisor implements DisplayListener { task.stack.removeTask(task, "restoreRecentTaskLocked", MOVING); } ActivityStack stack = final ActivityStack stack = getStack(stackId, CREATE_IF_NEEDED, !ON_TOP); if (stack == null) { Loading Loading @@ -3339,15 +3339,16 @@ public final class ActivityStackSupervisor implements DisplayListener { Slog.w(TAG, "moveTaskToStack: no task for id=" + taskId); return; } if (StackId.preserveWindowOnTaskMove(stackId)) { final ActivityRecord topActivity = task.getTopActivity(); if (StackId.preserveWindowOnTaskMove(stackId) && topActivity != null) { // We are about to relaunch the activity because its configuration changed due to // being maximized, i.e. size change. The activity will first remove the old window // and then add a new one. This call will tell window manager about this, so it can // preserve the old window until the new one is drawn. This prevents having a gap // between the removal and addition, in which no window is visible. We also want the // entrance of the new window to be properly animated. ActivityRecord r = task.getTopActivity(); mWindowManager.setReplacingWindow(r.appToken, true /* animate */); mWindowManager.setReplacingWindow(topActivity.appToken, true /* animate */); } final ActivityStack stack = moveTaskToStackUncheckedLocked(task, stackId, toTop, forceFocus, Loading
services/core/java/com/android/server/am/TaskRecord.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.am; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT; import static android.content.Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS; import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS; Loading Loading @@ -1366,6 +1367,8 @@ final class TaskRecord { sb.append(stringName); sb.append(" U="); sb.append(userId); sb.append(" StackId="); sb.append(stack != null ? stack.mStackId : INVALID_STACK_ID); sb.append(" sz="); sb.append(mActivities.size()); sb.append('}'); Loading