diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index 06902c550..61e6be91a 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -173,14 +173,13 @@ function Device:init() android.setScreenOffTimeout(-1) else local timeout = G_reader_settings:readSetting("android_screen_timeout") - if not timeout then return end - if timeout > 0 then + if timeout and timeout > 0 then -- set a custom timeout if we already have write settings permission. -- do not attempt to request permissions here. if android.canWriteSettings() then android.setScreenOffTimeout(timeout) end - elseif timeout == -1 then + elseif timeout and timeout == -1 then android.setScreenOffTimeout(timeout) end end