Kindle: toggle cover events

Allow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device

for those of use that stay in koreader, are caseless and have get spurious wakeups
This commit is contained in:
yparitcher
2023-05-03 10:26:35 -04:00
committed by GitHub
parent 4f23a6fafa
commit 1102c030fa
9 changed files with 81 additions and 63 deletions

View File

@@ -4,6 +4,7 @@ local Event = require("ui/event")
local InfoMessage = require("ui/widget/infomessage")
local Language = require("ui/language")
local NetworkMgr = require("ui/network/manager")
local PowerD = Device:getPowerDevice()
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local N_ = _.ngettext
@@ -236,6 +237,17 @@ if Device:isKobo() then
}
end
if Device:isKindle() and PowerD:hasHallSensor() then
common_settings.cover_events = {
text = _("Disable Kindle cover events"),
help_text = _([[Toggle the Hall effect sensor.
This is used to detect if the cover is closed, which will automatically sleep and wake the device. If there is no cover present the sensor may cause spurious wakeups when located next to a magnetic source.]]),
keep_menu_open = true,
checked_func = function() return not PowerD:isHallSensorEnabled() end,
callback = function() PowerD:onToggleHallSensor() end,
}
end
common_settings.night_mode = {
text = _("Night mode"),
checked_func = function() return G_reader_settings:isTrue("night_mode") end,