Loading libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionObserver.java +18 −1 Original line number Diff line number Diff line Loading @@ -98,9 +98,11 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs switch (change.getMode()) { case WindowManager.TRANSIT_OPEN: case WindowManager.TRANSIT_TO_FRONT: onOpenTransitionReady(change, startT, finishT); break; case WindowManager.TRANSIT_TO_FRONT: onToFrontTransitionReady(change, startT, finishT); break; case WindowManager.TRANSIT_CLOSE: { taskInfoList.add(change.getTaskInfo()); onCloseTransitionReady(change, startT, finishT); Loading Loading @@ -138,6 +140,21 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs change.getTaskInfo(), startT, finishT); } private void onToFrontTransitionReady( TransitionInfo.Change change, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { boolean exists = mWindowDecorViewModel.setupWindowDecorationForTransition( change.getTaskInfo(), startT, finishT); if (!exists) { // Window caption does not exist, create it mWindowDecorViewModel.createWindowDecoration( change.getTaskInfo(), change.getLeash(), startT, finishT); } } @Override public void onTransitionStarting(@NonNull IBinder transition) {} Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java +11 −4 Original line number Diff line number Diff line Loading @@ -105,6 +105,11 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel { SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { if (!shouldShowWindowDecor(taskInfo)) return false; CaptionWindowDecoration oldDecoration = mWindowDecorByTaskId.get(taskInfo.taskId); if (oldDecoration != null) { // close the old decoration if it exists to avoid two window decorations being added oldDecoration.close(); } final CaptionWindowDecoration windowDecoration = new CaptionWindowDecoration( mContext, mDisplayController, Loading Loading @@ -141,23 +146,25 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel { } @Override public void setupWindowDecorationForTransition( public boolean setupWindowDecorationForTransition( RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { final CaptionWindowDecoration decoration = mWindowDecorByTaskId.get(taskInfo.taskId); if (decoration == null) return; if (decoration == null) return false; decoration.relayout(taskInfo, startT, finishT); return true; } @Override public void destroyWindowDecoration(RunningTaskInfo taskInfo) { public boolean destroyWindowDecoration(RunningTaskInfo taskInfo) { final CaptionWindowDecoration decoration = mWindowDecorByTaskId.removeReturnOld(taskInfo.taskId); if (decoration == null) return; if (decoration == null) return false; decoration.close(); return true; } private class CaptionTouchEventListener implements Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java +5 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public interface WindowDecorViewModel { * @param taskSurface the surface of the task * @param startT the start transaction to be applied before the transition * @param finishT the finish transaction to restore states after the transition * @return the window decoration object * @return {@code true} if window decoration was created, {@code false} otherwise */ boolean createWindowDecoration( ActivityManager.RunningTaskInfo taskInfo, Loading @@ -66,8 +66,9 @@ public interface WindowDecorViewModel { * * @param startT the start transaction to be applied before the transition * @param finishT the finish transaction to restore states after the transition * @return {@code true} if window decoration exists, {@code false} otherwise */ void setupWindowDecorationForTransition( boolean setupWindowDecorationForTransition( ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT); Loading @@ -76,6 +77,7 @@ public interface WindowDecorViewModel { * Destroys the window decoration of the give task. * * @param taskInfo the info of the task * @return {@code true} if window decoration was destroyed, {@code false} otherwise */ void destroyWindowDecoration(ActivityManager.RunningTaskInfo taskInfo); boolean destroyWindowDecoration(ActivityManager.RunningTaskInfo taskInfo); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionObserver.java +18 −1 Original line number Diff line number Diff line Loading @@ -98,9 +98,11 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs switch (change.getMode()) { case WindowManager.TRANSIT_OPEN: case WindowManager.TRANSIT_TO_FRONT: onOpenTransitionReady(change, startT, finishT); break; case WindowManager.TRANSIT_TO_FRONT: onToFrontTransitionReady(change, startT, finishT); break; case WindowManager.TRANSIT_CLOSE: { taskInfoList.add(change.getTaskInfo()); onCloseTransitionReady(change, startT, finishT); Loading Loading @@ -138,6 +140,21 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs change.getTaskInfo(), startT, finishT); } private void onToFrontTransitionReady( TransitionInfo.Change change, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { boolean exists = mWindowDecorViewModel.setupWindowDecorationForTransition( change.getTaskInfo(), startT, finishT); if (!exists) { // Window caption does not exist, create it mWindowDecorViewModel.createWindowDecoration( change.getTaskInfo(), change.getLeash(), startT, finishT); } } @Override public void onTransitionStarting(@NonNull IBinder transition) {} Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java +11 −4 Original line number Diff line number Diff line Loading @@ -105,6 +105,11 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel { SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { if (!shouldShowWindowDecor(taskInfo)) return false; CaptionWindowDecoration oldDecoration = mWindowDecorByTaskId.get(taskInfo.taskId); if (oldDecoration != null) { // close the old decoration if it exists to avoid two window decorations being added oldDecoration.close(); } final CaptionWindowDecoration windowDecoration = new CaptionWindowDecoration( mContext, mDisplayController, Loading Loading @@ -141,23 +146,25 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel { } @Override public void setupWindowDecorationForTransition( public boolean setupWindowDecorationForTransition( RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT) { final CaptionWindowDecoration decoration = mWindowDecorByTaskId.get(taskInfo.taskId); if (decoration == null) return; if (decoration == null) return false; decoration.relayout(taskInfo, startT, finishT); return true; } @Override public void destroyWindowDecoration(RunningTaskInfo taskInfo) { public boolean destroyWindowDecoration(RunningTaskInfo taskInfo) { final CaptionWindowDecoration decoration = mWindowDecorByTaskId.removeReturnOld(taskInfo.taskId); if (decoration == null) return; if (decoration == null) return false; decoration.close(); return true; } private class CaptionTouchEventListener implements Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java +5 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public interface WindowDecorViewModel { * @param taskSurface the surface of the task * @param startT the start transaction to be applied before the transition * @param finishT the finish transaction to restore states after the transition * @return the window decoration object * @return {@code true} if window decoration was created, {@code false} otherwise */ boolean createWindowDecoration( ActivityManager.RunningTaskInfo taskInfo, Loading @@ -66,8 +66,9 @@ public interface WindowDecorViewModel { * * @param startT the start transaction to be applied before the transition * @param finishT the finish transaction to restore states after the transition * @return {@code true} if window decoration exists, {@code false} otherwise */ void setupWindowDecorationForTransition( boolean setupWindowDecorationForTransition( ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT); Loading @@ -76,6 +77,7 @@ public interface WindowDecorViewModel { * Destroys the window decoration of the give task. * * @param taskInfo the info of the task * @return {@code true} if window decoration was destroyed, {@code false} otherwise */ void destroyWindowDecoration(ActivityManager.RunningTaskInfo taskInfo); boolean destroyWindowDecoration(ActivityManager.RunningTaskInfo taskInfo); }