Loading services/core/java/com/android/server/wm/Task.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -4911,10 +4911,16 @@ class Task extends WindowContainer<WindowContainer> { task.mLastNonFullscreenBounds = lastNonFullscreenBounds; task.mLastNonFullscreenBounds = lastNonFullscreenBounds; task.setBounds(lastNonFullscreenBounds); task.setBounds(lastNonFullscreenBounds); task.mWindowLayoutAffinity = windowLayoutAffinity; task.mWindowLayoutAffinity = windowLayoutAffinity; if (activities.size() > 0) { // We need to add the task into hierarchy before adding child to it. final DisplayContent dc = taskSupervisor.mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY); dc.getDefaultTaskDisplayArea().addChild(task, POSITION_BOTTOM); for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { task.addChild(activities.get(activityNdx)); task.addChild(activities.get(activityNdx)); } } } if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Restored task=" + task); if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Restored task=" + task); return task; return task; Loading services/core/java/com/android/server/wm/TaskPersister.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -328,10 +328,19 @@ public class TaskPersister implements PersisterQueue.Listener { // mWriteQueue.add(new TaskWriteQueueItem(task)); // mWriteQueue.add(new TaskWriteQueueItem(task)); final int taskId = task.mTaskId; final int taskId = task.mTaskId; if (mService.mRootWindowContainer.anyTaskForId(taskId, final boolean persistedTask = task.hasActivity(); if (persistedTask && mRecentTasks.getTask(taskId) != null) { // The persisted task is added into hierarchy and will also be // added to recent tasks later. So this task should not exist // in recent tasks before it is added. Slog.wtf(TAG, "Existing persisted task with taskId " + taskId + " found"); } else if (!persistedTask && mService.mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) { MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) { // Should not happen. // Should not happen. Slog.wtf(TAG, "Existing task with taskId " + taskId + "found"); Slog.wtf(TAG, "Existing task with taskId " + taskId + " found"); } else if (userId != task.mUserId) { } else if (userId != task.mUserId) { // Should not happen. // Should not happen. Slog.wtf(TAG, "Task with userId " + task.mUserId + " found in " Slog.wtf(TAG, "Task with userId " + task.mUserId + " found in " Loading Loading
services/core/java/com/android/server/wm/Task.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -4911,10 +4911,16 @@ class Task extends WindowContainer<WindowContainer> { task.mLastNonFullscreenBounds = lastNonFullscreenBounds; task.mLastNonFullscreenBounds = lastNonFullscreenBounds; task.setBounds(lastNonFullscreenBounds); task.setBounds(lastNonFullscreenBounds); task.mWindowLayoutAffinity = windowLayoutAffinity; task.mWindowLayoutAffinity = windowLayoutAffinity; if (activities.size() > 0) { // We need to add the task into hierarchy before adding child to it. final DisplayContent dc = taskSupervisor.mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY); dc.getDefaultTaskDisplayArea().addChild(task, POSITION_BOTTOM); for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { task.addChild(activities.get(activityNdx)); task.addChild(activities.get(activityNdx)); } } } if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Restored task=" + task); if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Restored task=" + task); return task; return task; Loading
services/core/java/com/android/server/wm/TaskPersister.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -328,10 +328,19 @@ public class TaskPersister implements PersisterQueue.Listener { // mWriteQueue.add(new TaskWriteQueueItem(task)); // mWriteQueue.add(new TaskWriteQueueItem(task)); final int taskId = task.mTaskId; final int taskId = task.mTaskId; if (mService.mRootWindowContainer.anyTaskForId(taskId, final boolean persistedTask = task.hasActivity(); if (persistedTask && mRecentTasks.getTask(taskId) != null) { // The persisted task is added into hierarchy and will also be // added to recent tasks later. So this task should not exist // in recent tasks before it is added. Slog.wtf(TAG, "Existing persisted task with taskId " + taskId + " found"); } else if (!persistedTask && mService.mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) { MATCH_ATTACHED_TASK_OR_RECENT_TASKS) != null) { // Should not happen. // Should not happen. Slog.wtf(TAG, "Existing task with taskId " + taskId + "found"); Slog.wtf(TAG, "Existing task with taskId " + taskId + " found"); } else if (userId != task.mUserId) { } else if (userId != task.mUserId) { // Should not happen. // Should not happen. Slog.wtf(TAG, "Task with userId " + task.mUserId + " found in " Slog.wtf(TAG, "Task with userId " + task.mUserId + " found in " Loading