Loading packages/SystemUI/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -656,4 +656,10 @@ <!-- Y --> <!-- radius --> </integer-array> <!-- Overrides the behavior of the face unlock keyguard bypass setting: 0 - Don't override the setting (default) 1 - Override the setting to always bypass keyguard 2 - Override the setting to never bypass keyguard --> <integer name="config_face_unlock_bypass_override">0</integer> </resources> packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt +25 −1 Original line number Diff line number Diff line Loading @@ -16,11 +16,13 @@ package com.android.systemui.statusbar.phone import android.annotation.IntDef import android.content.Context import android.content.pm.PackageManager import android.hardware.biometrics.BiometricSourceType import android.provider.Settings import com.android.systemui.Dumpable import com.android.systemui.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -37,9 +39,18 @@ open class KeyguardBypassController : Dumpable { private val mKeyguardStateController: KeyguardStateController private val statusBarStateController: StatusBarStateController @BypassOverride private val bypassOverride: Int private var hasFaceFeature: Boolean private var pendingUnlock: PendingUnlock? = null @IntDef( FACE_UNLOCK_BYPASS_NO_OVERRIDE, FACE_UNLOCK_BYPASS_ALWAYS, FACE_UNLOCK_BYPASS_NEVER ) @Retention(AnnotationRetention.SOURCE) private annotation class BypassOverride /** * Pending unlock info: * Loading @@ -60,7 +71,14 @@ open class KeyguardBypassController : Dumpable { * If face unlock dismisses the lock screen or keeps user on keyguard for the current user. */ var bypassEnabled: Boolean = false get() = field && mKeyguardStateController.isFaceAuthEnabled get() { val enabled = when (bypassOverride) { FACE_UNLOCK_BYPASS_ALWAYS -> true FACE_UNLOCK_BYPASS_NEVER -> false else -> field } return enabled && mKeyguardStateController.isFaceAuthEnabled } private set var bouncerShowing: Boolean = false Loading @@ -86,6 +104,8 @@ open class KeyguardBypassController : Dumpable { this.mKeyguardStateController = keyguardStateController this.statusBarStateController = statusBarStateController bypassOverride = context.resources.getInteger(R.integer.config_face_unlock_bypass_override) hasFaceFeature = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE) if (!hasFaceFeature) { return Loading Loading @@ -198,5 +218,9 @@ open class KeyguardBypassController : Dumpable { companion object { const val BYPASS_PANEL_FADE_DURATION = 67 private const val FACE_UNLOCK_BYPASS_NO_OVERRIDE = 0 private const val FACE_UNLOCK_BYPASS_ALWAYS = 1 private const val FACE_UNLOCK_BYPASS_NEVER = 2 } } Loading
packages/SystemUI/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -656,4 +656,10 @@ <!-- Y --> <!-- radius --> </integer-array> <!-- Overrides the behavior of the face unlock keyguard bypass setting: 0 - Don't override the setting (default) 1 - Override the setting to always bypass keyguard 2 - Override the setting to never bypass keyguard --> <integer name="config_face_unlock_bypass_override">0</integer> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt +25 −1 Original line number Diff line number Diff line Loading @@ -16,11 +16,13 @@ package com.android.systemui.statusbar.phone import android.annotation.IntDef import android.content.Context import android.content.pm.PackageManager import android.hardware.biometrics.BiometricSourceType import android.provider.Settings import com.android.systemui.Dumpable import com.android.systemui.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -37,9 +39,18 @@ open class KeyguardBypassController : Dumpable { private val mKeyguardStateController: KeyguardStateController private val statusBarStateController: StatusBarStateController @BypassOverride private val bypassOverride: Int private var hasFaceFeature: Boolean private var pendingUnlock: PendingUnlock? = null @IntDef( FACE_UNLOCK_BYPASS_NO_OVERRIDE, FACE_UNLOCK_BYPASS_ALWAYS, FACE_UNLOCK_BYPASS_NEVER ) @Retention(AnnotationRetention.SOURCE) private annotation class BypassOverride /** * Pending unlock info: * Loading @@ -60,7 +71,14 @@ open class KeyguardBypassController : Dumpable { * If face unlock dismisses the lock screen or keeps user on keyguard for the current user. */ var bypassEnabled: Boolean = false get() = field && mKeyguardStateController.isFaceAuthEnabled get() { val enabled = when (bypassOverride) { FACE_UNLOCK_BYPASS_ALWAYS -> true FACE_UNLOCK_BYPASS_NEVER -> false else -> field } return enabled && mKeyguardStateController.isFaceAuthEnabled } private set var bouncerShowing: Boolean = false Loading @@ -86,6 +104,8 @@ open class KeyguardBypassController : Dumpable { this.mKeyguardStateController = keyguardStateController this.statusBarStateController = statusBarStateController bypassOverride = context.resources.getInteger(R.integer.config_face_unlock_bypass_override) hasFaceFeature = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE) if (!hasFaceFeature) { return Loading Loading @@ -198,5 +218,9 @@ open class KeyguardBypassController : Dumpable { companion object { const val BYPASS_PANEL_FADE_DURATION = 67 private const val FACE_UNLOCK_BYPASS_NO_OVERRIDE = 0 private const val FACE_UNLOCK_BYPASS_ALWAYS = 1 private const val FACE_UNLOCK_BYPASS_NEVER = 2 } }