diff options
Diffstat (limited to 'libs')
29 files changed, 107 insertions, 78 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationRunner.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationRunner.java index b917ac80256c..d9b73a8290f5 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationRunner.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationRunner.java @@ -83,10 +83,7 @@ class TaskFragmentAnimationRunner extends IRemoteAnimationRunner.Stub { } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { - if (TaskFragmentAnimationController.DEBUG) { - Log.v(TAG, "onAnimationCancelled: isKeyguardOccluded=" + isKeyguardOccluded); - } + public void onAnimationCancelled() { mHandler.post(this::cancelAnimation); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java index 22c90153bb39..edefe9e3ab06 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java @@ -404,7 +404,7 @@ class CrossActivityAnimation { } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { + public void onAnimationCancelled() { finishAnimation(); } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CustomizeActivityAnimation.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CustomizeActivityAnimation.java index f0c5d8b29b2f..2d6ec7547187 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CustomizeActivityAnimation.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CustomizeActivityAnimation.java @@ -323,7 +323,7 @@ class CustomizeActivityAnimation { } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { + public void onAnimationCancelled() { finishAnimation(); } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index f8f8897e41d5..b9ff5f0e820a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -282,6 +282,11 @@ public class BubbleStackView extends FrameLayout /** Whether the expanded view has been hidden, because we are dragging out a bubble. */ private boolean mExpandedViewTemporarilyHidden = false; + /** + * Whether the last bubble is being removed when expanded, which impacts the collapse animation. + */ + private boolean mRemovingLastBubbleWhileExpanded = false; + /** Animator for animating the expanded view's alpha (including the TaskView inside it). */ private final ValueAnimator mExpandedViewAlphaAnimator = ValueAnimator.ofFloat(0f, 1f); @@ -765,7 +770,7 @@ public class BubbleStackView extends FrameLayout // Update scrim if (!mScrimAnimating) { - showScrim(true); + showScrim(true, null /* runnable */); } } } @@ -880,6 +885,7 @@ public class BubbleStackView extends FrameLayout final Runnable onBubbleAnimatedOut = () -> { if (getBubbleCount() == 0) { + mExpandedViewTemporarilyHidden = false; mBubbleController.onAllBubblesAnimatedOut(); } }; @@ -1007,6 +1013,7 @@ public class BubbleStackView extends FrameLayout updatePointerPosition(false /* forIme */); mExpandedAnimationController.expandFromStack(() -> { afterExpandedViewAnimation(); + mExpandedViewContainer.setVisibility(VISIBLE); showManageMenu(mShowingManage); } /* after */); PointF p = mPositioner.getExpandedBubbleXY(getBubbleIndex(mExpandedBubble), @@ -1772,6 +1779,20 @@ public class BubbleStackView extends FrameLayout if (DEBUG_BUBBLE_STACK_VIEW) { Log.d(TAG, "removeBubble: " + bubble); } + if (isExpanded() && getBubbleCount() == 1) { + mRemovingLastBubbleWhileExpanded = true; + // We're expanded while the last bubble is being removed. Let the scrim animate away + // and then remove our views (removing the icon view triggers the removal of the + // bubble window so do that at the end of the animation so we see the scrim animate). + showScrim(false, () -> { + mRemovingLastBubbleWhileExpanded = false; + bubble.cleanupExpandedView(); + mBubbleContainer.removeView(bubble.getIconView()); + bubble.cleanupViews(); // cleans up the icon view + updateExpandedView(); // resets state for no expanded bubble + }); + return; + } // Remove it from the views for (int i = 0; i < getBubbleCount(); i++) { View v = mBubbleContainer.getChildAt(i); @@ -2142,7 +2163,7 @@ public class BubbleStackView extends FrameLayout mExpandedViewAlphaAnimator.start(); } - private void showScrim(boolean show) { + private void showScrim(boolean show, Runnable after) { AnimatorListenerAdapter listener = new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { @@ -2152,6 +2173,9 @@ public class BubbleStackView extends FrameLayout @Override public void onAnimationEnd(Animator animation) { mScrimAnimating = false; + if (after != null) { + after.run(); + } } }; if (show) { @@ -2178,7 +2202,7 @@ public class BubbleStackView extends FrameLayout } beforeExpandedViewAnimation(); - showScrim(true); + showScrim(true, null /* runnable */); updateZOrder(); updateBadges(false /* setBadgeForCollapsedStack */); mBubbleContainer.setActiveController(mExpandedAnimationController); @@ -2302,7 +2326,10 @@ public class BubbleStackView extends FrameLayout mIsExpanded = false; mIsExpansionAnimating = true; - showScrim(false); + if (!mRemovingLastBubbleWhileExpanded) { + // When we remove the last bubble it animates the scrim. + showScrim(false, null /* runnable */); + } mBubbleContainer.cancelAllAnimations(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java index d8e2f5c4a817..2f0f56cfdfb0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java @@ -634,14 +634,8 @@ public abstract class WMShellModule { @WMSingleton @Provides - static UnfoldBackgroundController provideUnfoldBackgroundController( - RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer, - Context context - ) { - return new UnfoldBackgroundController( - context, - rootTaskDisplayAreaOrganizer - ); + static UnfoldBackgroundController provideUnfoldBackgroundController(Context context) { + return new UnfoldBackgroundController(context); } // diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java index 2f25511a1f4d..643245943916 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java @@ -460,7 +460,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { + public void onAnimationCancelled() { final WindowContainerTransaction evictWct = new WindowContainerTransaction(); mStageCoordinator.prepareEvictInvisibleChildTasks(evictWct); mSyncQueue.queue(evictWct); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 49e8227c98f1..4c903f500651 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -483,7 +483,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { + public void onAnimationCancelled() { if (isEnteringSplit) { mMainExecutor.execute(() -> exitSplitScreen( mSideStage.getChildCount() == 0 ? mMainStage : mSideStage, @@ -869,7 +869,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, onRemoteAnimationFinished(apps); t.apply(); try { - adapter.getRunner().onAnimationCancelled(mKeyguardShowing); + adapter.getRunner().onAnimationCancelled(); } catch (RemoteException e) { Slog.e(TAG, "Error starting remote animation", e); } @@ -1013,11 +1013,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) { + public void onAnimationCancelled() { onRemoteAnimationFinishedOrCancelled(evictWct); setDividerVisibility(true, null); try { - adapter.getRunner().onAnimationCancelled(isKeyguardOccluded); + adapter.getRunner().onAnimationCancelled(); } catch (RemoteException e) { Slog.e(TAG, "Error starting remote animation", e); } @@ -1038,7 +1038,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, onRemoteAnimationFinished(apps); t.apply(); try { - adapter.getRunner().onAnimationCancelled(mKeyguardShowing); + adapter.getRunner().onAnimationCancelled(); } catch (RemoteException e) { Slog.e(TAG, "Error starting remote animation", e); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/LegacyTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/LegacyTransitions.java index 61e92f355dc2..61e11e877b90 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/LegacyTransitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/LegacyTransitions.java @@ -107,7 +107,7 @@ public class LegacyTransitions { } @Override - public void onAnimationCancelled(boolean isKeyguardOccluded) throws RemoteException { + public void onAnimationCancelled() throws RemoteException { mCancelled = true; mApps = mWallpapers = mNonApps = null; checkApply(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldBackgroundController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldBackgroundController.java index fe0a3fb7b9dc..96657af22e37 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldBackgroundController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldBackgroundController.java @@ -19,14 +19,12 @@ package com.android.wm.shell.unfold; import static android.graphics.Color.blue; import static android.graphics.Color.green; import static android.graphics.Color.red; -import static android.view.Display.DEFAULT_DISPLAY; import android.annotation.NonNull; import android.content.Context; import android.view.SurfaceControl; import com.android.wm.shell.R; -import com.android.wm.shell.RootTaskDisplayAreaOrganizer; /** * Controls background color layer for the unfold animations @@ -34,15 +32,10 @@ import com.android.wm.shell.RootTaskDisplayAreaOrganizer; public class UnfoldBackgroundController { private static final int BACKGROUND_LAYER_Z_INDEX = -1; - - private final RootTaskDisplayAreaOrganizer mRootTaskDisplayAreaOrganizer; private final float[] mBackgroundColor; private SurfaceControl mBackgroundLayer; - public UnfoldBackgroundController( - @NonNull Context context, - @NonNull RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) { - mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer; + public UnfoldBackgroundController(@NonNull Context context) { mBackgroundColor = getBackgroundColor(context); } @@ -57,7 +50,6 @@ public class UnfoldBackgroundController { .setName("app-unfold-background") .setCallsite("AppUnfoldTransitionController") .setColorLayer(); - mRootTaskDisplayAreaOrganizer.attachToDisplayArea(DEFAULT_DISPLAY, colorLayerBuilder); mBackgroundLayer = colorLayerBuilder.build(); transaction diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java index f9fdd831a42c..836efe0347c3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.content.res.TypedArray; import android.graphics.Point; import android.graphics.PointF; import android.graphics.Region; @@ -95,7 +96,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private int mWindowingPillHeight; private int mMoreActionsPillHeight; private int mShadowRadius; - private int mCornerRadius; + private int mMenuCornerRadius; DesktopModeWindowDecoration( Context context, @@ -182,6 +183,11 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mRelayoutParams.mShadowRadiusId = shadowRadiusID; mRelayoutParams.mApplyStartTransactionOnDraw = applyStartTransactionOnDraw; + final TypedArray ta = mContext.obtainStyledAttributes( + new int[]{android.R.attr.dialogCornerRadius}); + mRelayoutParams.mCornerRadius = ta.getDimensionPixelSize(0, 0); + ta.recycle(); + relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java index e772fc25f8cf..ac5ff2075901 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java @@ -16,6 +16,8 @@ package com.android.wm.shell.windowdecor; +import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; + import android.app.ActivityManager.RunningTaskInfo; import android.content.Context; import android.content.res.Configuration; @@ -256,13 +258,17 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f; mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f; mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f; - Point taskPosition = mTaskInfo.positionInParent; + final Point taskPosition = mTaskInfo.positionInParent; startT.setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight) .setShadowRadius(mTaskSurface, shadowRadius) .setColor(mTaskSurface, mTmpColor) .show(mTaskSurface); finishT.setPosition(mTaskSurface, taskPosition.x, taskPosition.y) .setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight); + if (mTaskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) { + startT.setCornerRadius(mTaskSurface, params.mCornerRadius); + finishT.setCornerRadius(mTaskSurface, params.mCornerRadius); + } if (mCaptionWindowManager == null) { // Put caption under a container surface because ViewRootImpl sets the destination frame @@ -414,6 +420,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> int mCaptionWidthId; int mShadowRadiusId; + int mCornerRadius; + int mCaptionX; int mCaptionY; @@ -425,6 +433,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> mCaptionWidthId = Resources.ID_NULL; mShadowRadiusId = Resources.ID_NULL; + mCornerRadius = 0; + mCaptionX = 0; mCaptionY = 0; diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/BaseTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/BaseTest.kt index c5ee7b722617..86edc25b64d3 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/BaseTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/BaseTest.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker import android.app.Instrumentation import android.platform.test.annotations.Presubmit -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerBuilderProvider import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt index 45024f387c25..798cc95c020f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt @@ -20,9 +20,9 @@ package com.android.wm.shell.flicker import android.tools.common.Rotation import android.tools.common.datatypes.Region -import android.tools.common.datatypes.component.IComponentMatcher import android.tools.common.flicker.subject.layers.LayerTraceEntrySubject import android.tools.common.flicker.subject.layers.LayersTraceSubject +import android.tools.common.traces.component.IComponentMatcher import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.helpers.WindowUtils @@ -218,11 +218,11 @@ fun FlickerTest.splitAppLayerBoundsChanges( assertLayers { if (landscapePosLeft) { splitAppLayerBoundsSnapToDivider( - component, - landscapePosLeft, - portraitPosTop, - scenario.endRotation - ) + component, + landscapePosLeft, + portraitPosTop, + scenario.endRotation + ) } else { splitAppLayerBoundsSnapToDivider( component, diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt index 983640a70c4b..3bc1e2acd015 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui" const val LAUNCHER_UI_PACKAGE_NAME = "com.google.android.apps.nexuslauncher" diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/BaseAppCompat.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/BaseAppCompat.kt index d01a0ee67f25..11c5951faa1f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/BaseAppCompat.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/BaseAppCompat.kt @@ -20,11 +20,11 @@ import android.content.Context import android.system.helpers.CommandsHelper import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest -import com.android.wm.shell.flicker.BaseTest -import com.android.server.wm.flicker.helpers.setRotation -import com.android.server.wm.flicker.helpers.LetterboxAppHelper import android.tools.device.flicker.legacy.FlickerTestFactory import android.tools.device.flicker.legacy.IFlickerTestData +import com.android.server.wm.flicker.helpers.LetterboxAppHelper +import com.android.server.wm.flicker.helpers.setRotation +import com.android.wm.shell.flicker.BaseTest import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd import com.android.wm.shell.flicker.appWindowIsVisibleAtStart import org.junit.Assume @@ -104,8 +104,8 @@ abstract class BaseAppCompat(flicker: FlickerTest) : BaseTest(flicker) { /** * Creates the test configurations. * - * See [FlickerTestFactory.rotationTests] for configuring screen orientation and - * navigation modes. + * See [FlickerTestFactory.rotationTests] for configuring screen orientation and navigation + * modes. */ @Parameterized.Parameters(name = "{0}") @JvmStatic diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/OpenAppInSizeCompatModeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/OpenAppInSizeCompatModeTest.kt index c57100e44c17..f212a4e0417e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/OpenAppInSizeCompatModeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/OpenAppInSizeCompatModeTest.kt @@ -17,11 +17,11 @@ package com.android.wm.shell.flicker.appcompat import android.platform.test.annotations.Postsubmit -import androidx.test.filters.RequiresDevice +import android.tools.common.traces.component.ComponentNameMatcher +import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest -import android.tools.device.flicker.junit.FlickerParametersRunnerFactory -import android.tools.common.datatypes.component.ComponentNameMatcher +import androidx.test.filters.RequiresDevice import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized @@ -35,13 +35,13 @@ import org.junit.runners.Parameterized * ``` * Rotate non resizable portrait only app to opposite orientation to trigger size compat mode * ``` + * * Notes: * ``` * Some default assertions (e.g., nav bar, status bar and screen covered) * are inherited [BaseTest] * ``` */ - @RequiresDevice @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @@ -86,4 +86,4 @@ class OpenAppInSizeCompatModeTest(flicker: FlickerTest) : BaseAppCompat(flicker) .isInvisible(ComponentNameMatcher.ROTATION) } } -}
\ No newline at end of file +} diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/RestartAppInSizeCompatModeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/RestartAppInSizeCompatModeTest.kt index f111a8d62d83..8e75439889b2 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/RestartAppInSizeCompatModeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/appcompat/RestartAppInSizeCompatModeTest.kt @@ -17,11 +17,11 @@ package com.android.wm.shell.flicker.appcompat import android.platform.test.annotations.Postsubmit -import androidx.test.filters.RequiresDevice +import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest -import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.helpers.WindowUtils +import androidx.test.filters.RequiresDevice import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized @@ -36,13 +36,13 @@ import org.junit.runners.Parameterized * Rotate app to opposite orientation to trigger size compat mode * Press restart button and wait for letterboxed app to resize * ``` + * * Notes: * ``` * Some default assertions (e.g., nav bar, status bar and screen covered) * are inherited [BaseTest] * ``` */ - @RequiresDevice @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @@ -56,9 +56,7 @@ class RestartAppInSizeCompatModeTest(flicker: FlickerTest) : BaseAppCompat(flick teardown { letterboxApp.exit(wmHelper) } } - @Postsubmit - @Test - fun appVisibleAtStartAndEnd() = assertLetterboxAppVisibleAtStartAndEnd() + @Postsubmit @Test fun appVisibleAtStartAndEnd() = assertLetterboxAppVisibleAtStartAndEnd() @Postsubmit @Test @@ -83,4 +81,4 @@ class RestartAppInSizeCompatModeTest(flicker: FlickerTest) : BaseAppCompat(flick val displayBounds = WindowUtils.getDisplayBounds(flicker.scenario.endRotation) flicker.assertLayersEnd { visibleRegion(letterboxApp).coversAtMost(displayBounds) } } -}
\ No newline at end of file +} diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/OpenActivityFromBubbleOnLocksreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/OpenActivityFromBubbleOnLocksreenTest.kt index 18a3aa79f6e2..889e1771593d 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/OpenActivityFromBubbleOnLocksreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/OpenActivityFromBubbleOnLocksreenTest.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.bubble import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest @@ -149,9 +149,7 @@ class OpenActivityFromBubbleOnLocksreenTest(flicker: FlickerTest) : BaseBubbleSc @Ignore("Not applicable to this CUJ. Taskbar is not shown on lock screen") override fun taskBarWindowIsAlwaysVisible() {} - /** - * Checks that the [ComponentNameMatcher.TASK_BAR] is visible at the end of the transition - */ + /** Checks that the [ComponentNameMatcher.TASK_BAR] is visible at the end of the transition */ @Postsubmit @Test fun taskBarLayerIsVisibleAtEnd() { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt index 59918fb7b6a9..e6544c9f39bc 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt @@ -17,7 +17,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt index 36c6f7c438c4..2417c45bf9a0 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher.Companion.LAUNCHER +import android.tools.common.traces.component.ComponentNameMatcher.Companion.LAUNCHER import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.flicker.legacy.FlickerTestFactory diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt index db18edba9cc4..4b4613704a16 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt @@ -21,7 +21,7 @@ import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt index 51f01364ec9c..bfd57786e615 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.flicker.legacy.FlickerTestFactory diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt index 2001f484ed96..5ac9829b6c8f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.flicker.legacy.FlickerTestFactory import com.android.server.wm.flicker.helpers.SimpleAppHelper diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt index 6deba1b68f38..bbb1c6c2ac63 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt index a626713aaa11..6b061bbb1565 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt @@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt index b30f30830156..eb1245b9ab86 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt @@ -20,7 +20,7 @@ import android.app.Instrumentation import android.content.Intent import android.platform.test.annotations.Presubmit import android.tools.common.Rotation -import android.tools.common.datatypes.component.ComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt index 0c9c16153ea3..d53eac073e6b 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt @@ -19,8 +19,8 @@ package com.android.wm.shell.flicker.splitscreen import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.IwTest import android.platform.test.annotations.Presubmit -import android.tools.common.datatypes.component.ComponentNameMatcher -import android.tools.common.datatypes.component.EdgeExtensionComponentMatcher +import android.tools.common.traces.component.ComponentNameMatcher +import android.tools.common.traces.component.EdgeExtensionComponentMatcher import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerTest diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt index 625987a2e7ef..1063dfd8d737 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt @@ -19,9 +19,9 @@ package com.android.wm.shell.flicker.splitscreen import android.app.Instrumentation import android.graphics.Point import android.os.SystemClock -import android.tools.common.datatypes.component.ComponentNameMatcher -import android.tools.common.datatypes.component.IComponentMatcher -import android.tools.common.datatypes.component.IComponentNameMatcher +import android.tools.common.traces.component.ComponentNameMatcher +import android.tools.common.traces.component.IComponentMatcher +import android.tools.common.traces.component.IComponentNameMatcher import android.tools.device.apphelpers.StandardAppHelper import android.tools.device.traces.parsers.WindowManagerStateHelper import android.tools.device.traces.parsers.toFlickerComponent diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java index fc4bfd9754a0..5a2326b9c393 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java @@ -16,6 +16,8 @@ package com.android.wm.shell.windowdecor; +import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; + import static com.android.wm.shell.MockSurfaceControlHelper.createMockSurfaceControlBuilder; import static com.android.wm.shell.MockSurfaceControlHelper.createMockSurfaceControlTransaction; @@ -86,6 +88,7 @@ import java.util.function.Supplier; public class WindowDecorationTests extends ShellTestCase { private static final Rect TASK_BOUNDS = new Rect(100, 300, 400, 400); private static final Point TASK_POSITION_IN_PARENT = new Point(40, 60); + private static final int CORNER_RADIUS = 20; private final WindowDecoration.RelayoutResult<TestView> mRelayoutResult = new WindowDecoration.RelayoutResult<>(); @@ -130,6 +133,7 @@ public class WindowDecorationTests extends ShellTestCase { mCaptionMenuShadowRadiusId = R.dimen.test_caption_menu_shadow_radius; mCaptionMenuCornerRadiusId = R.dimen.test_caption_menu_corner_radius; mRelayoutParams.mShadowRadiusId = R.dimen.test_window_decor_shadow_radius; + mRelayoutParams.mCornerRadius = CORNER_RADIUS; doReturn(mMockSurfaceControlViewHost).when(mMockSurfaceControlViewHostFactory) .create(any(), any(), any()); @@ -209,6 +213,7 @@ public class WindowDecorationTests extends ShellTestCase { .setBounds(TASK_BOUNDS) .setPositionInParent(TASK_POSITION_IN_PARENT.x, TASK_POSITION_IN_PARENT.y) .setVisible(true) + .setWindowingMode(WINDOWING_MODE_FREEFORM) .build(); taskInfo.isFocused = true; // Density is 2. Shadow radius is 10px. Caption height is 64px. @@ -249,6 +254,8 @@ public class WindowDecorationTests extends ShellTestCase { .setPosition(taskSurface, TASK_POSITION_IN_PARENT.x, TASK_POSITION_IN_PARENT.y); verify(mMockSurfaceControlFinishT) .setWindowCrop(taskSurface, 300, 100); + verify(mMockSurfaceControlStartT).setCornerRadius(taskSurface, CORNER_RADIUS); + verify(mMockSurfaceControlFinishT).setCornerRadius(taskSurface, CORNER_RADIUS); verify(mMockSurfaceControlStartT) .show(taskSurface); verify(mMockSurfaceControlStartT) |