pull/5220/head
Martín Fernández 5 years ago committed by Frans de Jonge
parent d9018faa5a
commit 3161673d70

@ -173,14 +173,13 @@ function Device:init()
android.setScreenOffTimeout(-1) android.setScreenOffTimeout(-1)
else else
local timeout = G_reader_settings:readSetting("android_screen_timeout") local timeout = G_reader_settings:readSetting("android_screen_timeout")
if not timeout then return end if timeout and timeout > 0 then
if timeout > 0 then
-- set a custom timeout if we already have write settings permission. -- set a custom timeout if we already have write settings permission.
-- do not attempt to request permissions here. -- do not attempt to request permissions here.
if android.canWriteSettings() then if android.canWriteSettings() then
android.setScreenOffTimeout(timeout) android.setScreenOffTimeout(timeout)
end end
elseif timeout == -1 then elseif timeout and timeout == -1 then
android.setScreenOffTimeout(timeout) android.setScreenOffTimeout(timeout)
end end
end end

Loading…
Cancel
Save