package eu.friedcutlet.yokan.services.media.player import android.view.WindowManager import eu.friedcutlet.yokan.AndroidForegroundActivity internal actual fun setPlayerScreenBrightness(level: Float?): Boolean { val activity = AndroidForegroundActivity.activity ?: return false activity.runOnUiThread { val window = activity.window ?: return@runOnUiThread window.attributes = window.attributes.apply { screenBrightness = level?.coerceIn(0.01f, 1f) ?: WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE } } return true }