Android - lights: return to previous level on cancel (#10726)

reviewable/pr10732/r1
hasezoey 10 months ago committed by GitHub
parent d350418367
commit 14347f0c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -499,6 +499,10 @@ function Device:_showLightDialog()
android.lights.showDialog(title, _("Brightness"), _("Warmth"), _("OK"), _("Cancel"))
local action = android.lights.dialogState()
while action == C.ALIGHTS_DIALOG_OPENED do
FFIUtil.usleep(250) -- dont pin the CPU
action = android.lights.dialogState()
end
if action == C.ALIGHTS_DIALOG_OK then
self.powerd.fl_intensity = self.powerd:frontlightIntensityHW()
logger.dbg("Dialog OK, brightness: " .. self.powerd.fl_intensity)

Loading…
Cancel
Save