setBrightness

fun setBrightness(brightness: Float)(source)

Sets Settings.System.SCREEN_BRIGHTNESS, falling back to the window attribute if the permission is absent.