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

Commit 027da773 authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Cherrypicker Worker
Browse files

Align lockscreen state and picker state for Device Controls shortcut

The picker state was previously checking if users had favorites, and
ignored if there were any panels. This caused wallpaper picker to not
let the user choose Device Controls on the lock screen.

The lockscreen state was already checking both of those. This aligns
these two.

Bug: 295852874
Test: atest HomeControlsKeyguardQuickAffordanceConfigParameterizedStateTest.kt
Test: manual reproduce the issue prior to this cl by not being able to select device controls - prove that the fixes here solve the issue
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bc161c912dfe2a6c7edbc737d38f34772a07d5d7)
Merged-In: Id98d0d16e11c3291dc4b906f7dd6e10d077ac96c
Change-Id: Id98d0d16e11c3291dc4b906f7dd6e10d077ac96c
parent 05f6991e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3081,7 +3081,7 @@
    configured. This is shown as part of a dialog that explains to the user why they cannot select
    this shortcut for their lock screen right now. [CHAR LIMIT=NONE].
    -->
    <string name="home_quick_affordance_unavailable_configure_the_app">&#8226; At least one device is available</string>
    <string name="home_quick_affordance_unavailable_configure_the_app">&#8226; At least one device or device panel are available</string>

    <!---
    Explains that the notes app is not available. This is shown as part of a dialog that explains to
+3 −2
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ constructor(
            component.getControlsListingController().getOrNull()?.getCurrentServices()
        val hasFavorites =
            component.getControlsController().getOrNull()?.getFavorites()?.isNotEmpty() == true
        val hasPanels = currentServices?.any { it.panelActivity != null } == true
        val componentPackageName = component.getPackageName()
        when {
            currentServices.isNullOrEmpty() && !componentPackageName.isNullOrEmpty() -> {
@@ -100,8 +101,8 @@ constructor(
                        ),
                )
            }
            !hasFavorites -> {
                // Home app installed but no favorites selected.
            !hasFavorites && !hasPanels -> {
                // Home app installed but no favorites selected or panel activities available.
                val activityClass = component.getControlsUiController().get().resolveActivity()
                return disabledPickerState(
                    explanation =
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ class HomeControlsKeyguardQuickAffordanceConfigParameterizedStateTest : SysuiTes
                    !isFeatureEnabled ->
                        KeyguardQuickAffordanceConfig.PickerScreenState.UnavailableOnDevice::class
                            .java
                    hasServiceInfos && hasFavorites ->
                    hasServiceInfos && (hasFavorites || hasPanels) ->
                        KeyguardQuickAffordanceConfig.PickerScreenState.Default::class.java
                    else -> KeyguardQuickAffordanceConfig.PickerScreenState.Disabled::class.java
                }