mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
do not request write settings permission at launch
This commit is contained in:
committed by
Frans de Jonge
parent
939538cc25
commit
50ce8d47cd
@@ -173,7 +173,14 @@ function Device:init()
|
||||
android.setScreenOffTimeout(-1)
|
||||
else
|
||||
local timeout = G_reader_settings:readSetting("android_screen_timeout")
|
||||
if timeout ~= nil and timeout ~= 0 then
|
||||
if not timeout then return end
|
||||
if 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
|
||||
android.setScreenOffTimeout(timeout)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user