Fix double-pressing reMarkable 2 power button twice to wake up (#7065)

reviewable/pr7037/r2
Glen Sawyer 3 years ago committed by GitHub
parent 578f92e424
commit 3bd3493014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -141,10 +141,22 @@ function Remarkable:setDateTime(year, month, day, hour, min, sec)
return os.execute(command) == 0
end
function Remarkable:suspend()
function Remarkable1:suspend()
os.execute("systemctl suspend")
end
function Remarkable2:suspend()
os.execute("systemctl suspend")
-- While device is suspended, when the user presses the power button and wakes up the device,
-- a "Power" event is NOT sent.
-- So we schedule a manual `UIManager:resume` call just far enough in the future that it won't
-- trigger before the `systemctl suspend` command finishes suspending the device
local UIManager = require("ui/uimanager")
UIManager:scheduleIn(0.5, function()
UIManager:resume()
end)
end
function Remarkable:resume()
end

Loading…
Cancel
Save