From bc9f60034ee7aff82be20f23c371ea5d0be087cc Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Tue, 14 Jun 2016 00:00:50 -0700 Subject: [PATCH] handle auto shutdown in pocketbook --- frontend/device/pocketbook/device.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/device/pocketbook/device.lua b/frontend/device/pocketbook/device.lua index 14d64fd03..fe8183873 100644 --- a/frontend/device/pocketbook/device.lua +++ b/frontend/device/pocketbook/device.lua @@ -57,6 +57,11 @@ function PocketBook:init() elseif self.isInBackGround and ev.type == EVT_FOREGROUND then self.isInBackGround = false self:onPowerEvent("Power") + elseif ev.type == EVT_EXIT then + -- auto shutdown event from inkview framework, gracefully close + -- everything and let the framework shutdown the device + require("ui/uimanager"):broadcastEvent( + require("ui/event"):new("Close")) elseif not self.isInBackGround and ev.type == EVT_FOREGROUND then self.screen:refreshPartial() end