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

Commit 5c38e0eb authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Automerger Merge Worker
Browse files

Merge "Default lockscreen customization on AOSP to disabled" into udc-dev am:...

Merge "Default lockscreen customization on AOSP to disabled" into udc-dev am: 8f9666c0 am: 4fd762bc am: a7e94104

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23180464



Change-Id: I3ce6e7314e5c01d411eee5346b821780611cdcd7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b446f39d a7e94104
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line 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)
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


#### On Lockscreen, occluded by an activity
#### On Lockscreen, occluded by an activity
+3 −1
Original line number Original line 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.
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
### 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
### 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.
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 Original line Diff line number Diff line
@@ -44,6 +44,12 @@
    <!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
    <!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
    <integer name="navigation_bar_deadzone_orientation">0</integer>
    <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>
    <bool name="config_dead_zone_flash">false</bool>


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


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


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


    private fun isFeatureEnabled(): Boolean {
    private fun isFeatureEnabled(): Boolean {
        return featureFlags.isEnabled(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED) &&
        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. */
    /** Updates application state to ask to show the menu. */
+6 −1
Original line number Original line Diff line number Diff line
@@ -19,12 +19,15 @@ package com.android.systemui.keyguard.domain.interactor


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