Loading core/java/android/window/flags/windowing_frontend.aconfig +11 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,17 @@ flag { } } } } flag { name: "release_surface_on_transition_finish" namespace: "windowing_frontend" description: "Reduce offscreen layers which rely on GC to release" bug: "407719374" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { flag { name: "cache_window_style" name: "cache_window_style" namespace: "windowing_frontend" namespace: "windowing_frontend" Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +18 −10 Original line number Original line Diff line number Diff line Loading @@ -357,6 +357,9 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { mInteractionJankMonitor.end(CUJ_DEFAULT_TASK_TO_TASK_ANIMATION); mInteractionJankMonitor.end(CUJ_DEFAULT_TASK_TO_TASK_ANIMATION); } } mAnimations.remove(transition); mAnimations.remove(transition); if (Flags.releaseSurfaceOnTransitionFinish()) { info.releaseAllSurfaces(); } finishCallback.onTransitionFinished(null /* wct */); finishCallback.onTransitionFinished(null /* wct */); }; }; Loading Loading @@ -623,8 +626,10 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { startTransaction.apply(); startTransaction.apply(); final boolean hasAnimations = !animations.isEmpty(); // now start animations. they are started on another thread, so we have to post them // now start animations. they are started on another thread, so we have to post them // *after* applying the startTransaction // *after* applying the startTransaction if (hasAnimations) { mAnimExecutor.execute(() -> { mAnimExecutor.execute(() -> { if (isTaskTransition) { if (isTaskTransition) { mInteractionJankMonitor.begin(info.getRoot(0).getLeash(), mContext, mInteractionJankMonitor.begin(info.getRoot(0).getLeash(), mContext, Loading @@ -634,11 +639,14 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { animations.get(i).start(); animations.get(i).start(); } } }); }); } mRotator.cleanUp(finishTransaction); mRotator.cleanUp(finishTransaction); TransitionMetrics.getInstance().reportAnimationStart(transition); TransitionMetrics.getInstance().reportAnimationStart(transition); // run finish now in-case there are no animations // run finish now in-case there are no animations if (!hasAnimations) { onAnimFinish.run(); onAnimFinish.run(); } return true; return true; } } Loading Loading
core/java/android/window/flags/windowing_frontend.aconfig +11 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,17 @@ flag { } } } } flag { name: "release_surface_on_transition_finish" namespace: "windowing_frontend" description: "Reduce offscreen layers which rely on GC to release" bug: "407719374" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { flag { name: "cache_window_style" name: "cache_window_style" namespace: "windowing_frontend" namespace: "windowing_frontend" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +18 −10 Original line number Original line Diff line number Diff line Loading @@ -357,6 +357,9 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { mInteractionJankMonitor.end(CUJ_DEFAULT_TASK_TO_TASK_ANIMATION); mInteractionJankMonitor.end(CUJ_DEFAULT_TASK_TO_TASK_ANIMATION); } } mAnimations.remove(transition); mAnimations.remove(transition); if (Flags.releaseSurfaceOnTransitionFinish()) { info.releaseAllSurfaces(); } finishCallback.onTransitionFinished(null /* wct */); finishCallback.onTransitionFinished(null /* wct */); }; }; Loading Loading @@ -623,8 +626,10 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { startTransaction.apply(); startTransaction.apply(); final boolean hasAnimations = !animations.isEmpty(); // now start animations. they are started on another thread, so we have to post them // now start animations. they are started on another thread, so we have to post them // *after* applying the startTransaction // *after* applying the startTransaction if (hasAnimations) { mAnimExecutor.execute(() -> { mAnimExecutor.execute(() -> { if (isTaskTransition) { if (isTaskTransition) { mInteractionJankMonitor.begin(info.getRoot(0).getLeash(), mContext, mInteractionJankMonitor.begin(info.getRoot(0).getLeash(), mContext, Loading @@ -634,11 +639,14 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { animations.get(i).start(); animations.get(i).start(); } } }); }); } mRotator.cleanUp(finishTransaction); mRotator.cleanUp(finishTransaction); TransitionMetrics.getInstance().reportAnimationStart(transition); TransitionMetrics.getInstance().reportAnimationStart(transition); // run finish now in-case there are no animations // run finish now in-case there are no animations if (!hasAnimations) { onAnimFinish.run(); onAnimFinish.run(); } return true; return true; } } Loading