Loading core/java/android/window/flags/windowing_frontend.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,14 @@ flag { bug: "232195501" } flag { name: "defer_display_updates" namespace: "window_manager" description: "Feature flag for deferring DisplayManager updates to WindowManager if Shell transition is running" bug: "259220649" is_fixed_read_only: true } flag { name: "close_to_square_config_includes_status_bar" namespace: "windowing_frontend" Loading services/tests/wmtests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ android_test { "truth", "testables", "hamcrest-library", "flag-junit", "platform-compat-test-rules", "CtsSurfaceValidatorLib", "service-sdksandbox.impl", Loading services/tests/wmtests/src/com/android/server/wm/SystemServiceTestsBase.java +14 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.wm; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import android.os.Handler; import android.platform.test.flag.junit.SetFlagsRule; import android.testing.DexmakerShareClassLoaderRule; import org.junit.Rule; Loading @@ -27,11 +28,16 @@ import java.util.concurrent.Callable; /** The base class which provides the common rule for test classes under wm package. */ class SystemServiceTestsBase { @Rule @Rule(order = 0) public final DexmakerShareClassLoaderRule mDexmakerShareClassLoaderRule = new DexmakerShareClassLoaderRule(); @Rule public final SystemServicesTestRule mSystemServicesTestRule = new SystemServicesTestRule(); @Rule(order = 1) public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Rule(order = 2) public final SystemServicesTestRule mSystemServicesTestRule = new SystemServicesTestRule( this::onBeforeSystemServicesCreated); @WindowTestRunner.MethodWrapperRule public final WindowManagerGlobalLockRule mLockRule = Loading Loading @@ -64,6 +70,11 @@ class SystemServiceTestsBase { return mLockRule.waitForLocked(callable); } /** * Called before system services are created */ protected void onBeforeSystemServicesCreated() {} /** * Make the system booted, so that {@link ActivityStack#resumeTopActivityInnerLocked} can really * be executed to update activity state and configuration when resuming the current top. Loading services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java +13 −0 Original line number Diff line number Diff line Loading @@ -134,11 +134,20 @@ public class SystemServicesTestRule implements TestRule { private WindowState.PowerManagerWrapper mPowerManagerWrapper; private InputManagerService mImService; private InputChannel mInputChannel; private Runnable mOnBeforeServicesCreated; /** * Spied {@link SurfaceControl.Transaction} class than can be used to verify calls. */ SurfaceControl.Transaction mTransaction; public SystemServicesTestRule(Runnable onBeforeServicesCreated) { mOnBeforeServicesCreated = onBeforeServicesCreated; } public SystemServicesTestRule() { this(/* onBeforeServicesCreated= */ null); } @Override public Statement apply(Statement base, Description description) { return new Statement() { Loading Loading @@ -168,6 +177,10 @@ public class SystemServicesTestRule implements TestRule { } private void setUp() { if (mOnBeforeServicesCreated != null) { mOnBeforeServicesCreated.run(); } // Use stubOnly() to reduce memory usage if it doesn't need verification. final MockSettings spyStubOnly = withSettings().stubOnly() .defaultAnswer(CALLS_REAL_METHODS); Loading Loading
core/java/android/window/flags/windowing_frontend.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,14 @@ flag { bug: "232195501" } flag { name: "defer_display_updates" namespace: "window_manager" description: "Feature flag for deferring DisplayManager updates to WindowManager if Shell transition is running" bug: "259220649" is_fixed_read_only: true } flag { name: "close_to_square_config_includes_status_bar" namespace: "windowing_frontend" Loading
services/tests/wmtests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ android_test { "truth", "testables", "hamcrest-library", "flag-junit", "platform-compat-test-rules", "CtsSurfaceValidatorLib", "service-sdksandbox.impl", Loading
services/tests/wmtests/src/com/android/server/wm/SystemServiceTestsBase.java +14 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.wm; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import android.os.Handler; import android.platform.test.flag.junit.SetFlagsRule; import android.testing.DexmakerShareClassLoaderRule; import org.junit.Rule; Loading @@ -27,11 +28,16 @@ import java.util.concurrent.Callable; /** The base class which provides the common rule for test classes under wm package. */ class SystemServiceTestsBase { @Rule @Rule(order = 0) public final DexmakerShareClassLoaderRule mDexmakerShareClassLoaderRule = new DexmakerShareClassLoaderRule(); @Rule public final SystemServicesTestRule mSystemServicesTestRule = new SystemServicesTestRule(); @Rule(order = 1) public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Rule(order = 2) public final SystemServicesTestRule mSystemServicesTestRule = new SystemServicesTestRule( this::onBeforeSystemServicesCreated); @WindowTestRunner.MethodWrapperRule public final WindowManagerGlobalLockRule mLockRule = Loading Loading @@ -64,6 +70,11 @@ class SystemServiceTestsBase { return mLockRule.waitForLocked(callable); } /** * Called before system services are created */ protected void onBeforeSystemServicesCreated() {} /** * Make the system booted, so that {@link ActivityStack#resumeTopActivityInnerLocked} can really * be executed to update activity state and configuration when resuming the current top. Loading
services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java +13 −0 Original line number Diff line number Diff line Loading @@ -134,11 +134,20 @@ public class SystemServicesTestRule implements TestRule { private WindowState.PowerManagerWrapper mPowerManagerWrapper; private InputManagerService mImService; private InputChannel mInputChannel; private Runnable mOnBeforeServicesCreated; /** * Spied {@link SurfaceControl.Transaction} class than can be used to verify calls. */ SurfaceControl.Transaction mTransaction; public SystemServicesTestRule(Runnable onBeforeServicesCreated) { mOnBeforeServicesCreated = onBeforeServicesCreated; } public SystemServicesTestRule() { this(/* onBeforeServicesCreated= */ null); } @Override public Statement apply(Statement base, Description description) { return new Statement() { Loading Loading @@ -168,6 +177,10 @@ public class SystemServicesTestRule implements TestRule { } private void setUp() { if (mOnBeforeServicesCreated != null) { mOnBeforeServicesCreated.run(); } // Use stubOnly() to reduce memory usage if it doesn't need verification. final MockSettings spyStubOnly = withSettings().stubOnly() .defaultAnswer(CALLS_REAL_METHODS); Loading