Merge "Avoid SettingNotFoundException"

This commit is contained in:
Lucas Dupin
2020-09-10 21:43:52 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 1 deletions

View File

@@ -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<out String>) {

View File

@@ -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))
}