Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java +6 −3 Original line number Diff line number Diff line Loading @@ -252,7 +252,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT } else { decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } } Loading @@ -266,7 +267,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } @Override Loading Loading @@ -362,7 +364,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT windowDecoration.setTaskDragResizer(taskPositioner); windowDecoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } private class CaptionTouchEventListener implements Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +8 −4 Original line number Diff line number Diff line Loading @@ -208,7 +208,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL // synced with the buffer transaction (that draws the View). Both will be shown on screen // at the same, whereas applying them independently causes flickering. See b/270202228. relayout(taskInfo, t, t, true /* applyStartTransactionOnDraw */, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion); shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false); } @VisibleForTesting Loading @@ -223,7 +224,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region globalExclusionRegion, boolean shouldSetBackground) { boolean shouldSetBackground, boolean inSyncWithTransition) { relayoutParams.reset(); relayoutParams.mRunningTaskInfo = taskInfo; relayoutParams.mLayoutResId = R.layout.caption_window_decor; Loading @@ -244,6 +246,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL relayoutParams.mIsCaptionVisible = taskInfo.isFreeform() || (isStatusBarVisible && !isKeyguardVisibleAndOccluded); relayoutParams.mDisplayExclusionRegion.set(globalExclusionRegion); relayoutParams.mInSyncWithTransition = inSyncWithTransition; if (TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) { // If the app is requesting to customize the caption bar, allow input to fall Loading Loading @@ -275,7 +278,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region globalExclusionRegion) { @NonNull Region globalExclusionRegion, boolean inSyncWithTransition) { final boolean isFreeform = taskInfo.getWindowingMode() == WindowConfiguration.WINDOWING_MODE_FREEFORM; final boolean isDragResizeable = ENABLE_WINDOWING_SCALED_RESIZING.isTrue() Loading @@ -289,7 +292,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo)); globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo), inSyncWithTransition); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +4 −3 Original line number Diff line number Diff line Loading @@ -644,7 +644,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } else { decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } } Loading Loading @@ -687,7 +688,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mExclusionRegion, /* inSyncWithTransition= */ true); } @Override Loading Loading @@ -1910,7 +1911,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, windowDecoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mExclusionRegion, /* inSyncWithTransition= */ true); if (!DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { incrementEventReceiverTasks(taskInfo.displayId); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −4 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin // causes flickering. See b/270202228. final boolean applyTransactionOnDraw = taskInfo.isFreeform(); relayout(taskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion); hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false); if (!applyTransactionOnDraw) { t.apply(); } Loading @@ -440,7 +440,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void relayout(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion) { boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean inSyncWithTransition) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_APP_TO_WEB.isTrue()) { Loading Loading @@ -479,7 +480,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin && DesktopModeFlags .ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX.isTrue(), mDesktopModeCompatPolicy.shouldExcludeCaptionFromAppBounds(taskInfo), mDesktopConfig); mDesktopConfig, inSyncWithTransition); final WindowDecorLinearLayout oldRootView = mResult.mRootView; final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; Loading Loading @@ -925,7 +926,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin @NonNull Region displayExclusionRegion, boolean shouldIgnoreCornerRadius, boolean shouldExcludeCaptionFromAppBounds, DesktopConfig desktopConfig) { DesktopConfig desktopConfig, boolean inSyncWithTransition) { final int captionLayoutId = getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode()); final boolean isAppHeader = captionLayoutId == R.layout.desktop_mode_app_header; Loading Loading @@ -1086,6 +1088,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } relayoutParams.mApplyStartTransactionOnDraw = applyStartTransactionOnDraw; relayoutParams.mSetTaskVisibilityPositionAndCrop = shouldSetTaskVisibilityPositionAndCrop; relayoutParams.mInSyncWithTransition = inSyncWithTransition; // The configuration used to layout the window decoration. A copy is made instead of using // the original reference so that the configuration isn't mutated on config changes and Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +38 −23 Original line number Diff line number Diff line Loading @@ -529,6 +529,37 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> .setPosition(mTaskSurface, taskPosition.x, taskPosition.y); } if (params.mSetTaskVisibilityPositionAndCrop) { startT.show(mTaskSurface); } if (params.mShouldSetBackground) { final int backgroundColorInt = mTaskInfo.taskDescription != null ? mTaskInfo.taskDescription.getBackgroundColor() : Color.BLACK; mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f; mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f; mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f; startT.setColor(mTaskSurface, mTmpColor); } else { startT.unsetColor(mTaskSurface); } updateTaskSurfaceOutline(params, startT, finishT, outResult); } private void updateTaskSurfaceOutline( RelayoutParams params, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, RelayoutResult<T> outResult) { if ((DesktopExperienceFlags.ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX.isTrue() || DesktopExperienceFlags.ENABLE_FREEFORM_BOX_SHADOWS.isTrue()) && !params.mInSyncWithTransition) { // Update these outline properties only when the relayout is driven by Transition // callbacks because they must be updated together with some of other properties (e.g., // position) which is set by transition handler although the outline properties are // expected to be set by WindowDecoration instead of the transition handler. return; } if (outResult.mBorderSettings != null && outResult.mBorderSettings.strokeWidth > 0) { startT.setBorderSettings(mTaskSurface, outResult.mBorderSettings); Loading @@ -546,34 +577,15 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> startT.setShadowRadius(mTaskSurface, outResult.mShadowRadius); finishT.setShadowRadius(mTaskSurface, outResult.mShadowRadius); } } else { if (params.mShadowRadius != INVALID_SHADOW_RADIUS) { startT.setShadowRadius(mTaskSurface, params.mShadowRadius); finishT.setShadowRadius(mTaskSurface, params.mShadowRadius); } } if (params.mSetTaskVisibilityPositionAndCrop) { startT.show(mTaskSurface); } if (params.mShouldSetBackground) { final int backgroundColorInt = mTaskInfo.taskDescription != null ? mTaskInfo.taskDescription.getBackgroundColor() : Color.BLACK; mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f; mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f; mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f; startT.setColor(mTaskSurface, mTmpColor); } else { startT.unsetColor(mTaskSurface); } if (DesktopExperienceFlags.ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX.isTrue()) { if (outResult.mCornerRadius != INVALID_CORNER_RADIUS) { startT.setCornerRadius(mTaskSurface, outResult.mCornerRadius); finishT.setCornerRadius(mTaskSurface, outResult.mCornerRadius); } } else { if (params.mShadowRadius != INVALID_SHADOW_RADIUS) { startT.setShadowRadius(mTaskSurface, params.mShadowRadius); finishT.setShadowRadius(mTaskSurface, params.mShadowRadius); } if (params.mCornerRadius != INVALID_CORNER_RADIUS) { startT.setCornerRadius(mTaskSurface, params.mCornerRadius); finishT.setCornerRadius(mTaskSurface, params.mCornerRadius); Loading Loading @@ -910,6 +922,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> boolean mShouldSetAppBounds; boolean mShouldSetBackground; boolean mInSyncWithTransition; void reset() { mLayoutResId = Resources.ID_NULL; mCaptionHeightCalculator = (ctx, display) -> 0; Loading Loading @@ -941,6 +955,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mHasGlobalFocus = false; mShouldSetAppBounds = false; mShouldSetBackground = false; mInSyncWithTransition = false; } boolean hasInputFeatureSpy() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java +6 −3 Original line number Diff line number Diff line Loading @@ -252,7 +252,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT } else { decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } } Loading @@ -266,7 +267,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } @Override Loading Loading @@ -362,7 +364,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT windowDecoration.setTaskDragResizer(taskPositioner); windowDecoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* setTaskCropAndPosition */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } private class CaptionTouchEventListener implements Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +8 −4 Original line number Diff line number Diff line Loading @@ -208,7 +208,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL // synced with the buffer transaction (that draws the View). Both will be shown on screen // at the same, whereas applying them independently causes flickering. See b/270202228. relayout(taskInfo, t, t, true /* applyStartTransactionOnDraw */, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion); shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false); } @VisibleForTesting Loading @@ -223,7 +224,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region globalExclusionRegion, boolean shouldSetBackground) { boolean shouldSetBackground, boolean inSyncWithTransition) { relayoutParams.reset(); relayoutParams.mRunningTaskInfo = taskInfo; relayoutParams.mLayoutResId = R.layout.caption_window_decor; Loading @@ -244,6 +246,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL relayoutParams.mIsCaptionVisible = taskInfo.isFreeform() || (isStatusBarVisible && !isKeyguardVisibleAndOccluded); relayoutParams.mDisplayExclusionRegion.set(globalExclusionRegion); relayoutParams.mInSyncWithTransition = inSyncWithTransition; if (TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) { // If the app is requesting to customize the caption bar, allow input to fall Loading Loading @@ -275,7 +278,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region globalExclusionRegion) { @NonNull Region globalExclusionRegion, boolean inSyncWithTransition) { final boolean isFreeform = taskInfo.getWindowingMode() == WindowConfiguration.WINDOWING_MODE_FREEFORM; final boolean isDragResizeable = ENABLE_WINDOWING_SCALED_RESIZING.isTrue() Loading @@ -289,7 +292,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo)); globalExclusionRegion, mDesktopConfig.shouldSetBackground(taskInfo), inSyncWithTransition); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +4 −3 Original line number Diff line number Diff line Loading @@ -644,7 +644,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } else { decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion, /* inSyncWithTransition= */ true); } } Loading Loading @@ -687,7 +688,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, decoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mExclusionRegion, /* inSyncWithTransition= */ true); } @Override Loading Loading @@ -1910,7 +1911,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, windowDecoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */, mFocusTransitionObserver.hasGlobalFocus(taskInfo), mExclusionRegion); mExclusionRegion, /* inSyncWithTransition= */ true); if (!DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { incrementEventReceiverTasks(taskInfo.displayId); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −4 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin // causes flickering. See b/270202228. final boolean applyTransactionOnDraw = taskInfo.isFreeform(); relayout(taskInfo, t, t, applyTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, hasGlobalFocus, displayExclusionRegion); hasGlobalFocus, displayExclusionRegion, /* inSyncWithTransition= */ false); if (!applyTransactionOnDraw) { t.apply(); } Loading @@ -440,7 +440,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void relayout(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskVisibilityPositionAndCrop, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion) { boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean inSyncWithTransition) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_APP_TO_WEB.isTrue()) { Loading Loading @@ -479,7 +480,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin && DesktopModeFlags .ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX.isTrue(), mDesktopModeCompatPolicy.shouldExcludeCaptionFromAppBounds(taskInfo), mDesktopConfig); mDesktopConfig, inSyncWithTransition); final WindowDecorLinearLayout oldRootView = mResult.mRootView; final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; Loading Loading @@ -925,7 +926,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin @NonNull Region displayExclusionRegion, boolean shouldIgnoreCornerRadius, boolean shouldExcludeCaptionFromAppBounds, DesktopConfig desktopConfig) { DesktopConfig desktopConfig, boolean inSyncWithTransition) { final int captionLayoutId = getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode()); final boolean isAppHeader = captionLayoutId == R.layout.desktop_mode_app_header; Loading Loading @@ -1086,6 +1088,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } relayoutParams.mApplyStartTransactionOnDraw = applyStartTransactionOnDraw; relayoutParams.mSetTaskVisibilityPositionAndCrop = shouldSetTaskVisibilityPositionAndCrop; relayoutParams.mInSyncWithTransition = inSyncWithTransition; // The configuration used to layout the window decoration. A copy is made instead of using // the original reference so that the configuration isn't mutated on config changes and Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +38 −23 Original line number Diff line number Diff line Loading @@ -529,6 +529,37 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> .setPosition(mTaskSurface, taskPosition.x, taskPosition.y); } if (params.mSetTaskVisibilityPositionAndCrop) { startT.show(mTaskSurface); } if (params.mShouldSetBackground) { final int backgroundColorInt = mTaskInfo.taskDescription != null ? mTaskInfo.taskDescription.getBackgroundColor() : Color.BLACK; mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f; mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f; mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f; startT.setColor(mTaskSurface, mTmpColor); } else { startT.unsetColor(mTaskSurface); } updateTaskSurfaceOutline(params, startT, finishT, outResult); } private void updateTaskSurfaceOutline( RelayoutParams params, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, RelayoutResult<T> outResult) { if ((DesktopExperienceFlags.ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX.isTrue() || DesktopExperienceFlags.ENABLE_FREEFORM_BOX_SHADOWS.isTrue()) && !params.mInSyncWithTransition) { // Update these outline properties only when the relayout is driven by Transition // callbacks because they must be updated together with some of other properties (e.g., // position) which is set by transition handler although the outline properties are // expected to be set by WindowDecoration instead of the transition handler. return; } if (outResult.mBorderSettings != null && outResult.mBorderSettings.strokeWidth > 0) { startT.setBorderSettings(mTaskSurface, outResult.mBorderSettings); Loading @@ -546,34 +577,15 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> startT.setShadowRadius(mTaskSurface, outResult.mShadowRadius); finishT.setShadowRadius(mTaskSurface, outResult.mShadowRadius); } } else { if (params.mShadowRadius != INVALID_SHADOW_RADIUS) { startT.setShadowRadius(mTaskSurface, params.mShadowRadius); finishT.setShadowRadius(mTaskSurface, params.mShadowRadius); } } if (params.mSetTaskVisibilityPositionAndCrop) { startT.show(mTaskSurface); } if (params.mShouldSetBackground) { final int backgroundColorInt = mTaskInfo.taskDescription != null ? mTaskInfo.taskDescription.getBackgroundColor() : Color.BLACK; mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f; mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f; mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f; startT.setColor(mTaskSurface, mTmpColor); } else { startT.unsetColor(mTaskSurface); } if (DesktopExperienceFlags.ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX.isTrue()) { if (outResult.mCornerRadius != INVALID_CORNER_RADIUS) { startT.setCornerRadius(mTaskSurface, outResult.mCornerRadius); finishT.setCornerRadius(mTaskSurface, outResult.mCornerRadius); } } else { if (params.mShadowRadius != INVALID_SHADOW_RADIUS) { startT.setShadowRadius(mTaskSurface, params.mShadowRadius); finishT.setShadowRadius(mTaskSurface, params.mShadowRadius); } if (params.mCornerRadius != INVALID_CORNER_RADIUS) { startT.setCornerRadius(mTaskSurface, params.mCornerRadius); finishT.setCornerRadius(mTaskSurface, params.mCornerRadius); Loading Loading @@ -910,6 +922,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> boolean mShouldSetAppBounds; boolean mShouldSetBackground; boolean mInSyncWithTransition; void reset() { mLayoutResId = Resources.ID_NULL; mCaptionHeightCalculator = (ctx, display) -> 0; Loading Loading @@ -941,6 +955,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mHasGlobalFocus = false; mShouldSetAppBounds = false; mShouldSetBackground = false; mInSyncWithTransition = false; } boolean hasInputFeatureSpy() { Loading