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

Commit 20e55efa authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

Defines default quick affordances.

As per product, we will go with Home Controls and Wallet on the left and
the right, respectively.

Fix: 262161691
Test: Manually verified that, after clearing app cache, system UI
displays home and wallet properly.

Change-Id: I6dc2c92f1da7c2d4adc3e6ed6218cfe1352bf1b7
parent f2add476
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -824,6 +824,8 @@
    slot. If the user did make a choice, even if the choice is the "None" option, the default is
    slot. If the user did make a choice, even if the choice is the "None" option, the default is
    ignored. -->
    ignored. -->
    <string-array name="config_keyguardQuickAffordanceDefaults" translatable="false">
    <string-array name="config_keyguardQuickAffordanceDefaults" translatable="false">
        <item>bottom_start:home</item>
        <item>bottom_end:wallet</item>
    </string-array>
    </string-array>


</resources>
</resources>
+4 −0
Original line number Original line Diff line number Diff line
@@ -165,6 +165,10 @@ class KeyguardQuickAffordanceLocalUserSelectionManagerTest : SysuiTestCase() {


    @Test
    @Test
    fun `remembers selections by user`() = runTest {
    fun `remembers selections by user`() = runTest {
        overrideResource(
            R.array.config_keyguardQuickAffordanceDefaults,
            arrayOf<String>(),
        )
        val slot1 = "slot_1"
        val slot1 = "slot_1"
        val slot2 = "slot_2"
        val slot2 = "slot_2"
        val affordance1 = "affordance_1"
        val affordance1 = "affordance_1"
+5 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,11 @@ class KeyguardQuickAffordanceRepositoryTest : SysuiTestCase() {
                userHandle = UserHandle.SYSTEM,
                userHandle = UserHandle.SYSTEM,
            )
            )


        overrideResource(
            R.array.config_keyguardQuickAffordanceDefaults,
            arrayOf<String>(),
        )

        underTest =
        underTest =
            KeyguardQuickAffordanceRepository(
            KeyguardQuickAffordanceRepository(
                appContext = context,
                appContext = context,
+6 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ package com.android.systemui.keyguard.domain.interactor
import android.os.UserHandle
import android.os.UserHandle
import androidx.test.filters.SmallTest
import androidx.test.filters.SmallTest
import com.android.internal.widget.LockPatternUtils
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.shared.model.ContentDescription
import com.android.systemui.common.shared.model.ContentDescription
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.Icon
@@ -290,6 +291,11 @@ class KeyguardQuickAffordanceInteractorTest : SysuiTestCase() {
    @Test
    @Test
    fun select() =
    fun select() =
        testScope.runTest {
        testScope.runTest {
            overrideResource(
                R.array.config_keyguardQuickAffordanceDefaults,
                arrayOf<String>(),
            )

            featureFlags.set(Flags.CUSTOMIZABLE_LOCK_SCREEN_QUICK_AFFORDANCES, true)
            featureFlags.set(Flags.CUSTOMIZABLE_LOCK_SCREEN_QUICK_AFFORDANCES, true)
            homeControls.setState(
            homeControls.setState(
                KeyguardQuickAffordanceConfig.LockScreenState.Visible(icon = ICON)
                KeyguardQuickAffordanceConfig.LockScreenState.Visible(icon = ICON)