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

Commit f309e40d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add focused display option to shade display developer option" into main

parents 157826ef d56d6345
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -671,14 +671,16 @@
    <string-array name="shade_display_awareness_entries" >
        <item>Device display only (Default)</item>
        <item>External display</item>
        <item>Latest status bar touch</item>
        <item>Focus-based</item>
    </string-array>

    <!-- Options for showing shade on external display for developers -->
    <string-array name="shade_display_awareness_summaries" >
        <item>Show shade on device display only </item>
        <item>Show device on single external display</item>
        <item>Show device on last focused display</item>
        <item>Show shade on single external display</item>
        <item>Show shade on display which last had its status bar interacted with</item>
        <item>Show shade on last focused display</item>
    </string-array>

    <!-- Values for showing shade on external display for developers -->
@@ -686,6 +688,7 @@
        <item>default_display</item>
        <item>any_external_display</item>
        <item>status_bar_latest_touch</item>
        <item>focused_display</item>
    </string-array>

</resources>
+11 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import com.android.systemui.kosmos.useUnconfinedTestDispatcher
import com.android.systemui.shade.display.AnyExternalShadeDisplayPolicy
import com.android.systemui.shade.display.DefaultDisplayShadePolicy
import com.android.systemui.shade.display.FakeShadeDisplayPolicy
import com.android.systemui.shade.display.FocusShadeDisplayPolicy
import com.android.systemui.shade.display.StatusBarTouchShadeDisplayPolicy
import com.android.systemui.testKosmos
import com.android.systemui.util.settings.fakeGlobalSettings
@@ -108,7 +109,7 @@ class ShadeDisplaysRepositoryTest : SysuiTestCase() {
        }

    @Test
    fun policy_updatesBasedOnSettingValue_focusBased() =
    fun policy_updatesBasedOnSettingValue_lastStatusBarTouch() =
        testScope.runTest {
            val underTest = createUnderTest()
            globalSettings.putString(DEVELOPMENT_SHADE_DISPLAY_AWARENESS, "status_bar_latest_touch")
@@ -117,6 +118,15 @@ class ShadeDisplaysRepositoryTest : SysuiTestCase() {
                .isInstanceOf(StatusBarTouchShadeDisplayPolicy::class.java)
        }

    @Test
    fun policy_updatesBasedOnSettingValue_focusBased() =
        testScope.runTest {
            val underTest = createUnderTest()
            globalSettings.putString(DEVELOPMENT_SHADE_DISPLAY_AWARENESS, "focused_display")

            assertThat(underTest.currentPolicy).isInstanceOf(FocusShadeDisplayPolicy::class.java)
        }

    @Test
    fun displayId_afterKeyguardHides_goesBackToPreviousDisplay() =
        testScope.runTest {
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ val Kosmos.shadeDisplayPolicies: Set<ShadeDisplayPolicy> by
            defaultShadeDisplayPolicy,
            anyExternalShadeDisplayPolicy,
            statusBarTouchShadeDisplayPolicy,
            focusShadeDisplayPolicy,
            FakeShadeDisplayPolicy,
        )
    }