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

Commit 111d4504 authored by Lingyu Feng's avatar Lingyu Feng
Browse files

Ensure the display mirroring switch is disabled after runing e2e tests

Bug: 392787946
Flag: com.android.server.display.feature.flags.enable_display_content_mode_management
Test: EnableDisplayMirroringSwitch DisableDisplayMirroringSwitch
Change-Id: I942c8aaa151997d970d160fe3218d041179824e5
parent 59f36d3e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.server.display.feature.flags.Flags.FLAG_ENABLE_DISPLAY_CONTEN
import com.android.systemui.shared.Flags.FLAG_STATUS_BAR_CONNECTED_DISPLAYS
import com.android.window.flags.Flags.FLAG_ENABLE_TASKBAR_CONNECTED_DISPLAYS
import com.android.wm.shell.Utils
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
@@ -66,6 +67,13 @@ abstract class DisableDisplayMirroringSwitch : TestScenarioBase() {
        wmHelper.StateSyncBuilder().withDesktopModeOnDisplay(connectedDisplayRule.addedDisplays[0])
            .waitForAndVerify()
    }

    @After
    fun teardown() {
        // Ensure the mirroring switch is disabled after running the test.
        Settings.Secure.putInt(instrumentation.context.contentResolver, MIRROR_SETTING, 0)
    }

    private companion object {
        const val MIRROR_SETTING = Settings.Secure.MIRROR_BUILT_IN_DISPLAY
    }
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.systemui.shared.Flags.FLAG_STATUS_BAR_CONNECTED_DISPLAYS
import com.android.window.flags.Flags.FLAG_ENABLE_TASKBAR_CONNECTED_DISPLAYS
import com.android.wm.shell.Utils
import org.junit.Assume
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -67,6 +68,12 @@ abstract class EnableDisplayMirroringSwitch : TestScenarioBase() {
            .waitForAndVerify()
    }

    @After
    fun teardown() {
        // Ensure the mirroring switch is disabled after running the test.
        Settings.Secure.putInt(instrumentation.context.contentResolver, MIRROR_SETTING, 0)
    }

    private companion object {
        const val MIRROR_SETTING = Settings.Secure.MIRROR_BUILT_IN_DISPLAY
    }