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

Commit d56d6345 authored by Daniel Akinola's avatar Daniel Akinola
Browse files

Add focused display option to shade display developer option

Adding a new option to the shade display developer setting that follows
the FocusedShadeDisplayPolicy (shade shows up on the last focused
display)

Bug: 391614971
Test: manual testing
Test: atest ShadeDisplaysRepositoryTest
Flag: EXEMPT bugfix
Change-Id: I0a0a602feecb80963d3397ada5ecd69f9cef02aa
parent ea66f9f4
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,
        )
    }