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

Commit 5fbc8995 authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

Default lockscreen customization on AOSP to disabled

This also defaults the long-press on keyguard to false

Bug: b/280968035
Test: atest KeyguardBottomAreaViewModelTest
Change-Id: I13f5f498971cbc0a179892881580107e6780419b
parent cf62ec54
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ Begins with the device in low power mode, with the display active for [AOD][3] o

An indication to power off the device most likely comes from one of two signals: the user presses the power button or the screen timeout has passed. This may [lock the device](#How-the-device-locks)

#### Long-pressing on keyguard

OEMs may choose to enable a long-press action that displays a button at the bottom of lockscreen. This button links to lockscreen customization. This can be achieved by overriding the `long_press_keyguard_customize_lockscreen_enabled` resource in `packages/SystemUI/res/values/config.xml`.

#### On Lockscreen

#### On Lockscreen, occluded by an activity
+3 −1
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@ Tests belong in the `packages/SystemUI/tests/src/com/android/systemui/keyguard/d
By default, AOSP ships with a "bottom right" and a "bottom left" slot, each with a slot capacity of `1`, allowing only one Quick Affordance on each side of the lock screen.

### Customizing Slots
OEMs may choose to override the IDs and number of slots and/or override the default capacities. This can be achieved by overridding the `config_keyguardQuickAffordanceSlots` resource in `packages/SystemUI/res/values/config.xml`.
OEMs may choose to enable customization of slots. An entry point in settings will appear when overriding the `custom_lockscreen_shortcuts_enabled` resource in `packages/SystemUI/res/values/config.xml`.

OEMs may also choose to override the IDs and number of slots and/or override the default capacities. This can be achieved by overridding the `config_keyguardQuickAffordanceSlots` resource in `packages/SystemUI/res/values/config.xml`.

### Default Quick Affordances
OEMs may also choose to predefine default Quick Affordances for each slot. To achieve this, a developer may override the `config_keyguardQuickAffordanceDefaults` resource in `packages/SystemUI/res/values/config.xml`. Note that defaults only work until the user of the device selects a different quick affordance for that slot, even if they select the "None" option.
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@
    <!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
    <integer name="navigation_bar_deadzone_orientation">0</integer>

    <!-- Whether or not lockscreen shortcuts can be customized -->
    <bool name="custom_lockscreen_shortcuts_enabled">false</bool>

    <!-- Whether or not long-pressing on keyguard will display to customize lockscreen -->
    <bool name="long_press_keyguard_customize_lockscreen_enabled">false</bool>

    <bool name="config_dead_zone_flash">false</bool>

    <!-- Whether to enable dimming navigation buttons when wallpaper is not visible, should be
+5 −1
Original line number Diff line number Diff line
@@ -17,12 +17,14 @@

package com.android.systemui.keyguard.domain.interactor

import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.view.accessibility.AccessibilityManager
import androidx.annotation.VisibleForTesting
import com.android.internal.logging.UiEvent
import com.android.internal.logging.UiEventLogger
import com.android.systemui.R
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
@@ -55,6 +57,7 @@ import kotlinx.coroutines.launch
class KeyguardLongPressInteractor
@Inject
constructor(
    @Application private val appContext: Context,
    @Application private val scope: CoroutineScope,
    transitionInteractor: KeyguardTransitionInteractor,
    repository: KeyguardRepository,
@@ -169,7 +172,8 @@ constructor(

    private fun isFeatureEnabled(): Boolean {
        return featureFlags.isEnabled(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED) &&
            featureFlags.isEnabled(Flags.REVAMPED_WALLPAPER_UI)
            featureFlags.isEnabled(Flags.REVAMPED_WALLPAPER_UI) &&
            appContext.resources.getBoolean(R.bool.long_press_keyguard_customize_lockscreen_enabled)
    }

    /** Updates application state to ask to show the menu. */
+6 −1
Original line number Diff line number Diff line
@@ -19,12 +19,15 @@ package com.android.systemui.keyguard.domain.interactor

import android.app.AlertDialog
import android.app.admin.DevicePolicyManager
import android.content.Context
import android.content.Intent
import android.util.Log
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.R
import com.android.systemui.animation.DialogLaunchAnimator
import com.android.systemui.animation.Expandable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.devicepolicy.areKeyguardShortcutsDisabled
import com.android.systemui.dock.DockManager
@@ -75,6 +78,7 @@ constructor(
    private val devicePolicyManager: DevicePolicyManager,
    private val dockManager: DockManager,
    @Background private val backgroundDispatcher: CoroutineDispatcher,
    @Application private val appContext: Context,
) {
    private val isUsingRepository: Boolean
        get() = featureFlags.isEnabled(Flags.CUSTOMIZABLE_LOCK_SCREEN_QUICK_AFFORDANCES)
@@ -408,7 +412,8 @@ constructor(
                name = Contract.FlagsTable.FLAG_NAME_CUSTOM_LOCK_SCREEN_QUICK_AFFORDANCES_ENABLED,
                value =
                    !isFeatureDisabledByDevicePolicy() &&
                        featureFlags.isEnabled(Flags.CUSTOMIZABLE_LOCK_SCREEN_QUICK_AFFORDANCES),
                        featureFlags.isEnabled(Flags.CUSTOMIZABLE_LOCK_SCREEN_QUICK_AFFORDANCES) &&
                        appContext.resources.getBoolean(R.bool.custom_lockscreen_shortcuts_enabled),
            ),
            KeyguardPickerFlag(
                name = Contract.FlagsTable.FLAG_NAME_CUSTOM_CLOCKS_ENABLED,
Loading