Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo), inSyncWithTransition, forceReinflation); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, getLeash(), mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo mBgExecutor.execute(() -> mTaskOrganizer.applyTransaction(wct)); Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CarWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayou updateRelayoutParams(mRelayoutParams, taskInfo, isCaptionVisible); relayout(mRelayoutParams, startT, finishT, wct, mRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, mRootView, getLeash(), mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo mBgExecutor.execute(() -> mTaskOrganizer.applyTransaction(wct)); Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +8 −8 Original line number Diff line number Diff line Loading @@ -429,7 +429,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final boolean applyTransactionOnDraw = taskInfo.isFreeform(); relayout(taskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false, /* forceReinflation= */ false); /* forceReinflation= */ false, getLeash()); if (!applyTransactionOnDraw) { t.apply(); } Loading @@ -444,7 +444,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final boolean applyTransactionOnDraw = mTaskInfo.isFreeform(); relayout(mTaskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mHasGlobalFocus, mExclusionRegion, /* inSyncWithTransition= */ false, /* forceReinflation= */ true); /* forceReinflation= */ true, getLeash()); if (!applyTransactionOnDraw) { t.apply(); } Loading Loading @@ -472,7 +472,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean inSyncWithTransition, boolean forceReinflation) { boolean inSyncWithTransition, boolean forceReinflation, SurfaceControl taskSurface) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_APP_TO_WEB.isTrue()) { Loading Loading @@ -527,7 +527,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; final WindowContainerTransaction wct = new WindowContainerTransaction(); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, taskSurface, mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo if (!wct.isEmpty()) { Loading Loading @@ -1309,7 +1309,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mUserContext, mTransitions, mTaskInfo, mTaskSurface, getLeash(), mDisplayController, mTaskResourceLoader, mSurfaceControlTransactionSupplier, Loading Loading @@ -1352,7 +1352,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private void createResizeVeilIfNeeded() { if (mResizeVeil != null) return; mResizeVeil = new ResizeVeil(mContext, mDisplayController, mTaskResourceLoader, mMainDispatcher, mMainScope, mTaskSurface, mMainDispatcher, mMainScope, getLeash(), mSurfaceControlTransactionSupplier, mTaskInfo); } Loading @@ -1361,7 +1361,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ public void showResizeVeil(Rect taskBounds) { createResizeVeilIfNeeded(); mResizeVeil.showVeil(mTaskSurface, taskBounds, mTaskInfo); mResizeVeil.showVeil(getLeash(), taskBounds, mTaskInfo); } /** Loading @@ -1369,7 +1369,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ public void showResizeVeil(SurfaceControl.Transaction tx, Rect taskBounds) { createResizeVeilIfNeeded(); mResizeVeil.showVeil(tx, mTaskSurface, taskBounds, mTaskInfo, false /* fadeIn */); mResizeVeil.showVeil(tx, getLeash(), taskBounds, mTaskInfo, false /* fadeIn */); } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +12 −2 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> final @NonNull DisplayController mDisplayController; final @NonNull DesktopModeEventLogger mDesktopModeEventLogger; final ShellTaskOrganizer mTaskOrganizer; final Supplier<SurfaceControl> mSurfaceControlSupplier; final Supplier<SurfaceControl.Builder> mSurfaceControlBuilderSupplier; final Supplier<SurfaceControl.Transaction> mSurfaceControlTransactionSupplier; final Supplier<WindowContainerTransaction> mWindowContainerTransactionSupplier; Loading @@ -156,7 +158,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> public Context mDecorWindowContext; int mLayoutResId; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public final SurfaceControl mTaskSurface; private SurfaceControl mTaskSurface; Display mDisplay; SurfaceControl mDecorationContainerSurface; Loading Loading @@ -219,6 +221,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mTaskInfo = taskInfo; mTaskSurface = cloneSurfaceControl(taskSurface, surfaceControlSupplier); mDesktopModeEventLogger = desktopModeEventLogger; mSurfaceControlSupplier = surfaceControlSupplier; mSurfaceControlBuilderSupplier = surfaceControlBuilderSupplier; mSurfaceControlTransactionSupplier = surfaceControlTransactionSupplier; mWindowContainerTransactionSupplier = windowContainerTransactionSupplier; Loading Loading @@ -258,7 +261,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> void relayout(RelayoutParams params, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, WindowContainerTransaction wct, T rootView, RelayoutResult<T> outResult) { SurfaceControl newTaskSurface, RelayoutResult<T> outResult) { Trace.beginSection("WindowDecoration#relayout"); outResult.reset(); if (params.mRunningTaskInfo != null) { Loading @@ -269,6 +272,13 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> final int oldLayoutResId = mLayoutResId; mLayoutResId = params.mLayoutResId; if (mDecorationContainerSurface != null && newTaskSurface != null && !newTaskSurface.isSameSurface(mTaskSurface)) { mTaskSurface.release(); mTaskSurface = cloneSurfaceControl(newTaskSurface, mSurfaceControlSupplier); startT.reparent(mDecorationContainerSurface, mTaskSurface); } if (!mTaskInfo.isVisible) { releaseViews(wct); if (params.mSetTaskVisibilityPositionAndCrop) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorationWrapper.kt +3 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,8 @@ private constructor( get() = when { defaultWindowDecor != null -> requireDefaultWindowDecor().taskSurface desktopWindowDecor != null -> requireDesktopWindowDecor().mTaskSurface captionWindowDecoration != null -> requireCaptionWindowDecor().mTaskSurface desktopWindowDecor != null -> requireDesktopWindowDecor().leash captionWindowDecoration != null -> requireCaptionWindowDecor().leash else -> error("Expected Non-null window decoration") } Loading Loading @@ -264,6 +264,7 @@ private constructor( displayExclusionRegion, inSyncWithTransition, /* forceReinflation= */ false, taskSurface, ) } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo), inSyncWithTransition, forceReinflation); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, getLeash(), mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo mBgExecutor.execute(() -> mTaskOrganizer.applyTransaction(wct)); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CarWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayou updateRelayoutParams(mRelayoutParams, taskInfo, isCaptionVisible); relayout(mRelayoutParams, startT, finishT, wct, mRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, mRootView, getLeash(), mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo mBgExecutor.execute(() -> mTaskOrganizer.applyTransaction(wct)); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +8 −8 Original line number Diff line number Diff line Loading @@ -429,7 +429,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final boolean applyTransactionOnDraw = taskInfo.isFreeform(); relayout(taskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false, /* forceReinflation= */ false); /* forceReinflation= */ false, getLeash()); if (!applyTransactionOnDraw) { t.apply(); } Loading @@ -444,7 +444,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final boolean applyTransactionOnDraw = mTaskInfo.isFreeform(); relayout(mTaskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mHasGlobalFocus, mExclusionRegion, /* inSyncWithTransition= */ false, /* forceReinflation= */ true); /* forceReinflation= */ true, getLeash()); if (!applyTransactionOnDraw) { t.apply(); } Loading Loading @@ -472,7 +472,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean inSyncWithTransition, boolean forceReinflation) { boolean inSyncWithTransition, boolean forceReinflation, SurfaceControl taskSurface) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_APP_TO_WEB.isTrue()) { Loading Loading @@ -527,7 +527,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; final WindowContainerTransaction wct = new WindowContainerTransaction(); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, taskSurface, mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo if (!wct.isEmpty()) { Loading Loading @@ -1309,7 +1309,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mUserContext, mTransitions, mTaskInfo, mTaskSurface, getLeash(), mDisplayController, mTaskResourceLoader, mSurfaceControlTransactionSupplier, Loading Loading @@ -1352,7 +1352,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private void createResizeVeilIfNeeded() { if (mResizeVeil != null) return; mResizeVeil = new ResizeVeil(mContext, mDisplayController, mTaskResourceLoader, mMainDispatcher, mMainScope, mTaskSurface, mMainDispatcher, mMainScope, getLeash(), mSurfaceControlTransactionSupplier, mTaskInfo); } Loading @@ -1361,7 +1361,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ public void showResizeVeil(Rect taskBounds) { createResizeVeilIfNeeded(); mResizeVeil.showVeil(mTaskSurface, taskBounds, mTaskInfo); mResizeVeil.showVeil(getLeash(), taskBounds, mTaskInfo); } /** Loading @@ -1369,7 +1369,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ public void showResizeVeil(SurfaceControl.Transaction tx, Rect taskBounds) { createResizeVeilIfNeeded(); mResizeVeil.showVeil(tx, mTaskSurface, taskBounds, mTaskInfo, false /* fadeIn */); mResizeVeil.showVeil(tx, getLeash(), taskBounds, mTaskInfo, false /* fadeIn */); } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +12 −2 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> final @NonNull DisplayController mDisplayController; final @NonNull DesktopModeEventLogger mDesktopModeEventLogger; final ShellTaskOrganizer mTaskOrganizer; final Supplier<SurfaceControl> mSurfaceControlSupplier; final Supplier<SurfaceControl.Builder> mSurfaceControlBuilderSupplier; final Supplier<SurfaceControl.Transaction> mSurfaceControlTransactionSupplier; final Supplier<WindowContainerTransaction> mWindowContainerTransactionSupplier; Loading @@ -156,7 +158,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> public Context mDecorWindowContext; int mLayoutResId; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public final SurfaceControl mTaskSurface; private SurfaceControl mTaskSurface; Display mDisplay; SurfaceControl mDecorationContainerSurface; Loading Loading @@ -219,6 +221,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mTaskInfo = taskInfo; mTaskSurface = cloneSurfaceControl(taskSurface, surfaceControlSupplier); mDesktopModeEventLogger = desktopModeEventLogger; mSurfaceControlSupplier = surfaceControlSupplier; mSurfaceControlBuilderSupplier = surfaceControlBuilderSupplier; mSurfaceControlTransactionSupplier = surfaceControlTransactionSupplier; mWindowContainerTransactionSupplier = windowContainerTransactionSupplier; Loading Loading @@ -258,7 +261,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> void relayout(RelayoutParams params, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, WindowContainerTransaction wct, T rootView, RelayoutResult<T> outResult) { SurfaceControl newTaskSurface, RelayoutResult<T> outResult) { Trace.beginSection("WindowDecoration#relayout"); outResult.reset(); if (params.mRunningTaskInfo != null) { Loading @@ -269,6 +272,13 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> final int oldLayoutResId = mLayoutResId; mLayoutResId = params.mLayoutResId; if (mDecorationContainerSurface != null && newTaskSurface != null && !newTaskSurface.isSameSurface(mTaskSurface)) { mTaskSurface.release(); mTaskSurface = cloneSurfaceControl(newTaskSurface, mSurfaceControlSupplier); startT.reparent(mDecorationContainerSurface, mTaskSurface); } if (!mTaskInfo.isVisible) { releaseViews(wct); if (params.mSetTaskVisibilityPositionAndCrop) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorationWrapper.kt +3 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,8 @@ private constructor( get() = when { defaultWindowDecor != null -> requireDefaultWindowDecor().taskSurface desktopWindowDecor != null -> requireDesktopWindowDecor().mTaskSurface captionWindowDecoration != null -> requireCaptionWindowDecor().mTaskSurface desktopWindowDecor != null -> requireDesktopWindowDecor().leash captionWindowDecoration != null -> requireCaptionWindowDecor().leash else -> error("Expected Non-null window decoration") } Loading Loading @@ -264,6 +264,7 @@ private constructor( displayExclusionRegion, inSyncWithTransition, /* forceReinflation= */ false, taskSurface, ) } Loading