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

Commit f59b105a authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Avoid SettingNotFoundException

Fixes: 167648761
Test: atest FaceAuthScreenBrightnessControllerTest
Change-Id: I8aa1a9bf8610035fc4d23ed1f83d036d7d98799f
parent 01d4ef82
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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)
        userDefinedBrightness = systemSettings.getFloat(SCREEN_BRIGHTNESS_FLOAT, 1f)
    }
    }


    override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) {
    override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,8 @@ class FaceAuthScreenBrightnessControllerTest : SysuiTestCase() {
            override fun createAnimator(start: Float, end: Float) = animator
            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))).thenReturn(INITIAL_BRIGHTNESS)
        `when`(systemSettings.getFloat(eq(SCREEN_BRIGHTNESS_FLOAT), eq(1f)))
                .thenReturn(INITIAL_BRIGHTNESS)
        faceAuthScreenBrightnessController.attach(whiteOverlay)
        faceAuthScreenBrightnessController.attach(whiteOverlay)
        verify(keyguardUpdateMonitor).registerCallback(capture(keyguardUpdateCallback))
        verify(keyguardUpdateMonitor).registerCallback(capture(keyguardUpdateCallback))
    }
    }