Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +42 −27 Original line number Diff line number Diff line Loading @@ -652,9 +652,16 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } continue; } final Rect boundsOnScreen = tv.prepareOpen(chg.getTaskInfo(), chg.getLeash()); if (boundsOnScreen != null) { if (wct == null) wct = new WindowContainerTransaction(); updateBounds(tv, boundsOnScreen, startTransaction, finishTransaction, chg.getTaskInfo(), chg.getLeash(), wct); } else { startTransaction.reparent(chg.getLeash(), tv.getSurfaceControl()); finishTransaction.reparent(chg.getLeash(), tv.getSurfaceControl()) .setPosition(chg.getLeash(), 0, 0); } changesHandled++; } } Loading Loading @@ -683,6 +690,36 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV WindowContainerTransaction wct) { final Rect boundsOnScreen = taskView.prepareOpen(taskInfo, leash); if (boundsOnScreen != null) { updateBounds(taskView, boundsOnScreen, startTransaction, finishTransaction, taskInfo, leash, wct); } else { // The surface has already been destroyed before the task has appeared, // so go ahead and hide the task entirely wct.setHidden(taskInfo.token, true /* hidden */); updateVisibilityState(taskView, false /* visible */); // listener callback is below } if (newTask) { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* intercept */); } if (taskInfo.taskDescription != null) { int backgroundColor = taskInfo.taskDescription.getBackgroundColor(); taskView.setResizeBgColor(startTransaction, backgroundColor); } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); taskView.notifyAppeared(newTask); } private void updateBounds(TaskViewTaskController taskView, Rect boundsOnScreen, SurfaceControl.Transaction startTransaction, SurfaceControl.Transaction finishTransaction, ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash, WindowContainerTransaction wct) { final SurfaceControl tvSurface = taskView.getSurfaceControl(); // Surface is ready, so just reparent the task to this surface control startTransaction.reparent(leash, tvSurface) Loading @@ -692,7 +729,6 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV if (finishTransaction != null) { finishTransaction.reparent(leash, tvSurface) .setPosition(leash, 0, 0) // TODO: maybe once b/280900002 is fixed this will be unnecessary .setWindowCrop(leash, boundsOnScreen.width(), boundsOnScreen.height()); } if (useRepo()) { Loading @@ -707,27 +743,6 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } wct.setBounds(taskInfo.token, boundsOnScreen); taskView.applyCaptionInsetsIfNeeded(); } else { // The surface has already been destroyed before the task has appeared, // so go ahead and hide the task entirely wct.setHidden(taskInfo.token, true /* hidden */); updateVisibilityState(taskView, false /* visible */); // listener callback is below } if (newTask) { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* intercept */); } if (taskInfo.taskDescription != null) { int backgroundColor = taskInfo.taskDescription.getBackgroundColor(); taskView.setResizeBgColor(startTransaction, backgroundColor); } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); taskView.notifyAppeared(newTask); } /** Interface for running an external transition in this object's pending queue. */ Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +42 −27 Original line number Diff line number Diff line Loading @@ -652,9 +652,16 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } continue; } final Rect boundsOnScreen = tv.prepareOpen(chg.getTaskInfo(), chg.getLeash()); if (boundsOnScreen != null) { if (wct == null) wct = new WindowContainerTransaction(); updateBounds(tv, boundsOnScreen, startTransaction, finishTransaction, chg.getTaskInfo(), chg.getLeash(), wct); } else { startTransaction.reparent(chg.getLeash(), tv.getSurfaceControl()); finishTransaction.reparent(chg.getLeash(), tv.getSurfaceControl()) .setPosition(chg.getLeash(), 0, 0); } changesHandled++; } } Loading Loading @@ -683,6 +690,36 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV WindowContainerTransaction wct) { final Rect boundsOnScreen = taskView.prepareOpen(taskInfo, leash); if (boundsOnScreen != null) { updateBounds(taskView, boundsOnScreen, startTransaction, finishTransaction, taskInfo, leash, wct); } else { // The surface has already been destroyed before the task has appeared, // so go ahead and hide the task entirely wct.setHidden(taskInfo.token, true /* hidden */); updateVisibilityState(taskView, false /* visible */); // listener callback is below } if (newTask) { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* intercept */); } if (taskInfo.taskDescription != null) { int backgroundColor = taskInfo.taskDescription.getBackgroundColor(); taskView.setResizeBgColor(startTransaction, backgroundColor); } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); taskView.notifyAppeared(newTask); } private void updateBounds(TaskViewTaskController taskView, Rect boundsOnScreen, SurfaceControl.Transaction startTransaction, SurfaceControl.Transaction finishTransaction, ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash, WindowContainerTransaction wct) { final SurfaceControl tvSurface = taskView.getSurfaceControl(); // Surface is ready, so just reparent the task to this surface control startTransaction.reparent(leash, tvSurface) Loading @@ -692,7 +729,6 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV if (finishTransaction != null) { finishTransaction.reparent(leash, tvSurface) .setPosition(leash, 0, 0) // TODO: maybe once b/280900002 is fixed this will be unnecessary .setWindowCrop(leash, boundsOnScreen.width(), boundsOnScreen.height()); } if (useRepo()) { Loading @@ -707,27 +743,6 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } wct.setBounds(taskInfo.token, boundsOnScreen); taskView.applyCaptionInsetsIfNeeded(); } else { // The surface has already been destroyed before the task has appeared, // so go ahead and hide the task entirely wct.setHidden(taskInfo.token, true /* hidden */); updateVisibilityState(taskView, false /* visible */); // listener callback is below } if (newTask) { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* intercept */); } if (taskInfo.taskDescription != null) { int backgroundColor = taskInfo.taskDescription.getBackgroundColor(); taskView.setResizeBgColor(startTransaction, backgroundColor); } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); taskView.notifyAppeared(newTask); } /** Interface for running an external transition in this object's pending queue. */ Loading