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

Commit 106425ca authored by Jerry Liu's avatar Jerry Liu
Browse files

System UI: Rename desktop_screen_capture flag to large_screen_screencapture

Also change the boolean |config_enableDesktopScreenCapture| to |config_enableLargeScreenScreencapture|.

Bug: 434989619
Test: atest ScreenRecordTileTest
Flag: com.android.systemui.large_screen_screencapture
Change-Id: I88bdb4ee1c45cf94ba9cd9b545711e1ada4af9a4
parent 7f37e37d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1909,9 +1909,9 @@ flag {
}

flag {
    name: "desktop_screen_capture"
    name: "large_screen_screencapture"
    namespace: "systemui"
    description: "Enables the pre and post capture UI and the Quick Settings button for the desktop screen capture feature."
    description: "Enables the pre and post capture UI and the Quick Settings button for the Large Screen screen capture feature."
    bug: "412421893"
}

+4 −4
Original line number Diff line number Diff line
@@ -225,10 +225,10 @@ public class ScreenRecordTileTest extends SysuiTestCase {
        verify(mController, times(1)).cancelCountdown();
    }

    // Test that clicking the tile is NOP if opened from desktop.
    // Test that clicking the tile is NOP if opened from large screen.
    @Test
    @EnableFlags({Flags.FLAG_DESKTOP_SCREEN_CAPTURE, Flags.FLAG_NEW_SCREEN_RECORD_TOOLBAR})
    public void testClickFromDesktop() {
    @EnableFlags({Flags.FLAG_LARGE_SCREEN_SCREENCAPTURE, Flags.FLAG_NEW_SCREEN_RECORD_TOOLBAR})
    public void testClickFromLargeScreen() {
        when(mController.isStarting()).thenReturn(false);
        when(mController.isRecording()).thenReturn(false);

@@ -240,7 +240,7 @@ public class ScreenRecordTileTest extends SysuiTestCase {
        verify(mController, never()).createScreenRecordDialog(null);
    }

    // Test that clicking the tile in desktop opens the recording dialog if flag is disabled.
    // Test that clicking the tile opens the recording dialog if flag is disabled.
    @Test
    @DisableFlags(Flags.FLAG_NEW_SCREEN_RECORD_TOOLBAR)
    public void testClickNewToolbarFlagDisabled() {
+8 −8
Original line number Diff line number Diff line
@@ -96,14 +96,14 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
        verify(screenRecordUxController).cancelCountdown()
    }

    // Test that clicking the tile is NOP if opened from desktop.
    // Test that clicking the tile is NOP if opened from large screen.
    @Test
    @EnableFlags(Flags.FLAG_DESKTOP_SCREEN_CAPTURE, Flags.FLAG_NEW_SCREEN_RECORD_TOOLBAR)
    fun handleClick_fromDesktop_flagEnabled_isNOP() = runTest {
    @EnableFlags(Flags.FLAG_LARGE_SCREEN_SCREENCAPTURE, Flags.FLAG_NEW_SCREEN_RECORD_TOOLBAR)
    fun handleClick_fromLargeScreen_flagEnabled_isNOP() = runTest {
        val recordingModel = ScreenRecordModel.DoingNothing

        // Override the resource to enable desktop features.
        underTest.apply { overrideResource(R.bool.config_enableDesktopScreenCapture, true) }
        // Override the resource to enable large screen features.
        underTest.apply { overrideResource(R.bool.config_enableLargeScreenScreencapture, true) }

        underTest.handleInput(QSTileInputTestKtx.click(recordingModel))
        val onStartRecordingClickedCaptor = argumentCaptor<Runnable>()
@@ -111,11 +111,11 @@ class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() {
            .createScreenRecordDialog(onStartRecordingClickedCaptor.capture())
    }

    // Test that clicking the tile not in desktop opens the recording dialog when the flag is
    // Test that clicking the tile not in large screen opens the recording dialog when the flag is
    // disabled.
    @Test
    @DisableFlags(Flags.FLAG_DESKTOP_SCREEN_CAPTURE)
    fun handleClick_desktopFlagDisabled_opensRecordingDialog() = runTest {
    @DisableFlags(Flags.FLAG_LARGE_SCREEN_SCREENCAPTURE)
    fun handleClick_largeScreenFlagDisabled_opensRecordingDialog() = runTest {
        val recordingModel = ScreenRecordModel.DoingNothing

        underTest.handleInput(QSTileInputTestKtx.click(recordingModel))
+2 −2
Original line number Diff line number Diff line
@@ -47,14 +47,14 @@ class ScreenCaptureRecordFeaturesInteractorTest : SysuiTestCase() {
            val isLargeScreen by collectLastValue(underTest.isLargeScreen)

            testableContext.orCreateTestableResources.addOverride(
                R.bool.config_enableDesktopScreenCapture,
                R.bool.config_enableLargeScreenScreencapture,
                true,
            )
            configurationController.onConfigurationChanged(testableContext.resources.configuration)
            assertThat(isLargeScreen).isTrue()

            testableContext.orCreateTestableResources.addOverride(
                R.bool.config_enableDesktopScreenCapture,
                R.bool.config_enableLargeScreenScreencapture,
                false,
            )
            configurationController.onConfigurationChanged(testableContext.resources.configuration)
+2 −2
Original line number Diff line number Diff line
@@ -1155,8 +1155,8 @@
    <!-- If AOD can show an ambient version of the wallpaper (-1 means ignore) -->
    <integer name="config_dozeSupportsAodWallpaperOverride">-1</integer>

    <!-- Whether to enable the desktop screen capture. -->
    <bool name="config_enableDesktopScreenCapture">false</bool>
    <!-- Whether to enable large screen UI for screen capture. -->
    <bool name="config_enableLargeScreenScreencapture">false</bool>

    <!-- Whether to enable features improving large screen interaction -->
    <bool name="config_improveLargeScreenInteractionOnLockscreen">false</bool>
Loading