diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt index 9dcc3bb6fbdc2..a7d17e128ff32 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt @@ -177,7 +177,7 @@ open class FaceAuthScreenBrightnessController( userDefinedBrightness = systemSettings.getFloat(SCREEN_BRIGHTNESS_FLOAT) } }) - userDefinedBrightness = systemSettings.getFloat(SCREEN_BRIGHTNESS_FLOAT) + userDefinedBrightness = systemSettings.getFloat(SCREEN_BRIGHTNESS_FLOAT, 1f) } override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt index 58cb0324c69a8..73a7ca93507d2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt @@ -87,6 +87,8 @@ class FaceAuthScreenBrightnessControllerTest : SysuiTestCase() { override fun createAnimator(start: Float, end: Float) = animator } `when`(systemSettings.getFloat(eq(SCREEN_BRIGHTNESS_FLOAT))).thenReturn(INITIAL_BRIGHTNESS) + `when`(systemSettings.getFloat(eq(SCREEN_BRIGHTNESS_FLOAT), eq(1f))) + .thenReturn(INITIAL_BRIGHTNESS) faceAuthScreenBrightnessController.attach(whiteOverlay) verify(keyguardUpdateMonitor).registerCallback(capture(keyguardUpdateCallback)) }