Skip to content

Commit

Permalink
[feat] Kindle suspend using lipc (koreader#4825)
Browse files Browse the repository at this point in the history
Fixes problems with making Kindle go to sleep using menu or gesture manager action.
  • Loading branch information
Galunid authored and Frenzie committed Mar 21, 2019
1 parent d58774b commit 5f44ef5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions frontend/device/kindle/powerd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@ function KindlePowerD:afterResume()
end
end

function KindlePowerD:toggleSuspend()
if self.lipc_handle then
self.lipc_handle:set_int_property("com.lab126.powerd", "powerButton", 1)
end
end

return KindlePowerD
2 changes: 1 addition & 1 deletion frontend/ui/uimanager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ function UIManager:suspend()
if Device:isCervantes() or Device:isKobo() or Device:isSDL() or Device:isSonyPRSTUX() then
self.event_handlers["Suspend"]()
elseif Device:isKindle() then
self.event_handlers["IntoSS"]()
Device.powerd:toggleSuspend()
end
end

Expand Down

0 comments on commit 5f44ef5

Please sign in to comment.