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

Commit f6c60281 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Remove enabled flag wait_for_transition_on_display_switch" into main

parents adcb2c4d 911a8bce
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -8,16 +8,6 @@ flag {
  bug: "232195501"
}

flag {
    name: "wait_for_transition_on_display_switch"
    namespace: "windowing_frontend"
    description: "Waits for Shell transition to start before unblocking the screen after display switch"
    bug: "301420598"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "apply_lifecycle_on_pip_change"
    namespace: "windowing_frontend"
+0 −2
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.display.BrightnessSynchronizer;
import com.android.internal.protolog.ProtoLog;
import com.android.server.wm.utils.DisplayInfoOverrides.DisplayInfoFieldsUpdater;
import com.android.window.flags.Flags;

import java.util.Arrays;
import java.util.Objects;
@@ -336,7 +335,6 @@ class DeferredDisplayUpdater {

    /** Returns {@code true} if the transition will control when to turn on the screen. */
    boolean waitForTransition(@NonNull Message screenUnblocker) {
        if (!Flags.waitForTransitionOnDisplaySwitch()) return false;
        if (!mShouldWaitForTransitionWhenScreenOn) {
            return false;
        }
+0 −15
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import androidx.test.filters.SmallTest;

import com.android.server.LocalServices;
import com.android.server.wm.TransitionController.OnStartCollect;
import com.android.window.flags.Flags;

import org.junit.Before;
import org.junit.Test;
@@ -218,7 +217,6 @@ public class DisplayContentDeferredUpdateTests extends WindowTestsBase {

    @Test
    public void testWaitForTransition_displaySwitching_waitsForTransitionToBeStarted() {
        mSetFlagsRule.enableFlags(Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH);
        mDisplayContent.mDisplayUpdater.onDisplaySwitching(/* switching= */ true);
        boolean willWait = mDisplayContent.mDisplayUpdater.waitForTransition(mScreenUnblocker);
        assertThat(willWait).isTrue();
@@ -241,7 +239,6 @@ public class DisplayContentDeferredUpdateTests extends WindowTestsBase {

    @Test
    public void testWaitForTransition_displayNotSwitching_doesNotWait() {
        mSetFlagsRule.enableFlags(Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH);
        mDisplayContent.mDisplayUpdater.onDisplaySwitching(/* switching= */ false);

        boolean willWait = mDisplayContent.mDisplayUpdater.waitForTransition(mScreenUnblocker);
@@ -250,20 +247,8 @@ public class DisplayContentDeferredUpdateTests extends WindowTestsBase {
        verify(mScreenUnblocker, never()).sendToTarget();
    }

    @Test
    public void testWaitForTransition_displayIsSwitchingButFlagDisabled_doesNotWait() {
        mSetFlagsRule.disableFlags(Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH);
        mDisplayContent.mDisplayUpdater.onDisplaySwitching(/* switching= */ true);

        boolean willWait = mDisplayContent.mDisplayUpdater.waitForTransition(mScreenUnblocker);

        assertThat(willWait).isFalse();
        verify(mScreenUnblocker, never()).sendToTarget();
    }

    @Test
    public void testTwoDisplayUpdateAtTheSameTime_bothDisplaysAreUnblocked() {
        mSetFlagsRule.enableFlags(Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH);
        prepareSecondaryDisplay();

        final WindowState defaultDisplayWindow = newWindowBuilder("DefaultDisplayWindow",