Merge cherrypicks of [7825093, 7824346, 7824349, 7823902, 7823903, 7825189, 7825190, 7825191, 7825192, 7825193, 7825195, 7825196, 7825197, 7825204, 7825205, 7825206, 7825207, 7825208, 7825209, 7825210, 7825211, 7825618, 7825619, 7825620, 7825621, 7825622, 7825623, 7825521, 7825522, 7825523, 7825524, 7825525, 7825698, 7825699] into qt-c2f2-release
Change-Id: Id29c45b2a292e2b268959f5a32e0154ca968c5fa
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index fb58569..483ec37 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4117,6 +4117,9 @@
<integer-array name="config_face_acquire_vendor_biometricprompt_ignorelist" translatable="false" >
</integer-array>
+ <!-- If face auth sends the user directly to home/last open app, or stays on keyguard -->
+ <bool name="config_faceAuthDismissesKeyguard">true</bool>
+
<!-- The component name for the default profile supervisor, which can be set as a profile owner
even after user setup is complete. The defined component should be used for supervision purposes
only. The component must be part of a system app. -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index d910be9..7563a45 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2581,6 +2581,7 @@
<java-symbol type="array" name="config_face_acquire_vendor_keyguard_ignorelist" />
<java-symbol type="array" name="config_face_acquire_biometricprompt_ignorelist" />
<java-symbol type="array" name="config_face_acquire_vendor_biometricprompt_ignorelist" />
+ <java-symbol type="bool" name="config_faceAuthDismissesKeyguard" />
<!-- Face config -->
<java-symbol type="integer" name="config_faceMaxTemplatesPerUser" />
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 19e7b73..6039568 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -40,9 +40,6 @@
<!-- Whether or not we show the number in the bar. -->
<bool name="config_statusBarShowNumber">false</bool>
- <!-- If the lock screen should be dismissed after biometric auth. -->
- <bool name="config_faceAuthDismissesKeyguard">false</bool>
-
<!-- Vibrator pattern for camera gesture launch. -->
<integer-array translatable="false" name="config_cameraLaunchGestureVibePattern">
<item>0</item>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
index 61fc1a3c..3613f9f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
@@ -147,11 +147,16 @@
// Let's notify the scroller that an animation started
notifyAnimationStart(mLinearDozeAmount == 1.0f)
}
+ setDozeAmount(linear, eased)
+ }
+
+ fun setDozeAmount(linear: Float, eased: Float) {
+ val changed = linear != mLinearDozeAmount
mLinearDozeAmount = linear
mDozeAmount = eased
mStackScroller.setDozeAmount(mDozeAmount)
updateDarkAmount()
- if (linear == 0.0f) {
+ if (changed && linear == 0.0f) {
setNotificationsVisible(visible = false, animate = false, increaseSpeed = false);
setNotificationsVisibleForExpansion(visible = false, animate = false,
increaseSpeed = false)
@@ -164,16 +169,12 @@
private fun updateDozeAmountIfBypass(): Boolean {
if (mBypassController.bypassEnabled) {
+ var amount = 1.0f;
if (mStatusBarStateController.state == StatusBarState.SHADE
|| mStatusBarStateController.state == StatusBarState.SHADE_LOCKED) {
- mDozeAmount = 0.0f
- mLinearDozeAmount = 0.0f
- } else {
- mDozeAmount = 1.0f
- mLinearDozeAmount = 1.0f
+ amount = 0.0f;
}
- updateDarkAmount()
- mStackScroller.setDozeAmount(mDozeAmount)
+ setDozeAmount(amount, amount)
return true
}
return false
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
index 5b5eb76..5abf39e7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
@@ -17,10 +17,10 @@
package com.android.systemui.statusbar.phone
import android.content.Context
+import android.hardware.face.FaceManager
import android.provider.Settings
import com.android.internal.annotations.VisibleForTesting
import com.android.keyguard.KeyguardUpdateMonitor
-import com.android.systemui.R
import com.android.systemui.tuner.TunerService
import javax.inject.Inject
@@ -32,8 +32,13 @@
@Inject
constructor(context: Context,
tunerService: TunerService) {
- val dismissByDefault = if (context.getResources().getBoolean(
- R.bool.config_faceAuthDismissesKeyguard)) 1 else 0
+ val faceManager = context.getSystemService(FaceManager::class.java)
+ if (faceManager?.isHardwareDetected != true) {
+ return
+ }
+
+ val dismissByDefault = if (context.resources.getBoolean(
+ com.android.internal.R.bool.config_faceAuthDismissesKeyguard)) 1 else 0
tunerService.addTunable(
object : TunerService.Tunable {
override fun onTuningChanged(key: String?, newValue: String?) {