Final fixes for kobo suspend

This commit is contained in:
Giorgio Micotti
2013-09-30 21:48:46 +02:00
parent afd4a2d920
commit a2ff9b9a9b
2 changed files with 17 additions and 22 deletions

View File

@@ -152,18 +152,16 @@ function Device:outofScreenSaver()
self.screen_saver_mode = false
end
function Device:Suspend()
UIManager:show(InfoMessage:new{
text = _("Standby"),
timeout = 4,
})
Screen:refresh(0)
function Device:prepareSuspend()
local fl = self:getFrontlight()
if fl ~= nil then
fl:sleep()
fl.fl:sleep()
end
util.usleep(1500000)
Screen:refresh(0)
self.screen_saver_mode = true
end
function Device:Suspend()
os.execute("./kobo_suspend.sh")
end
@@ -173,19 +171,11 @@ function Device:Resume()
Screen:refresh(0)
local fl = self:getFrontlight()
if fl ~= nil then
fl:resume()
fl.fl:restore()
end
self.screen_saver_mode = false
end
function Device:Power()
if self.screen_saver_mode == true then
self:Resume()
else
self:Suspend()
end
end
function Device:usbPlugIn()
--os.execute("echo 'usb in' >> /mnt/us/event_test.txt")
if self.charging_mode == false and self.screen_saver_mode == false then