Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a4f6c81 authored by Nick Chameyev's avatar Nick Chameyev Committed by Android (Google) Code Review
Browse files

Merge "Add defer display updates trunk stable flag" into main

parents 44459dd8 ff5c5188
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ android_test {
        "truth",
        "testables",
        "hamcrest-library",
        "flag-junit",
        "platform-compat-test-rules",
        "CtsSurfaceValidatorLib",
        "service-sdksandbox.impl",
+14 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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 =
@@ -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.
+13 −0
Original line number Diff line number Diff line
@@ -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() {
@@ -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);