mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Only ask to start an USBMS session when plugged into a USB host on Kobo (#6645)
* Only ask to start an USBMS session when plugged into a USB host on Kobo Also, fix a typo that broke plugout detection on cervantes * Bump base (necessary input/KoboUSBMS changes) https://github.com/koreader/koreader-base/pull/1183
This commit is contained in:
2
base
2
base
Submodule base updated: 8efd649950...7e52fff017
@@ -155,6 +155,20 @@ function UIManager:init()
|
||||
Device:getPowerDevice():toggleFrontlight()
|
||||
end
|
||||
self.event_handlers["Charging"] = function()
|
||||
self:_beforeCharging()
|
||||
-- NOTE: Plug/unplug events will wake the device up, which is why we put it back to sleep.
|
||||
if Device.screen_saver_mode then
|
||||
self:suspend()
|
||||
end
|
||||
end
|
||||
self.event_handlers["NotCharging"] = function()
|
||||
-- We need to put the device into suspension, other things need to be done before it.
|
||||
self:_afterNotCharging()
|
||||
if Device.screen_saver_mode then
|
||||
self:suspend()
|
||||
end
|
||||
end
|
||||
self.event_handlers["UsbPlugIn"] = function()
|
||||
self:_beforeCharging()
|
||||
-- NOTE: Plug/unplug events will wake the device up, which is why we put it back to sleep.
|
||||
if Device.screen_saver_mode then
|
||||
@@ -165,7 +179,7 @@ function UIManager:init()
|
||||
MassStorage:start()
|
||||
end
|
||||
end
|
||||
self.event_handlers["NotCharging"] = function()
|
||||
self.event_handlers["UsbPlugOut"] = function()
|
||||
-- We need to put the device into suspension, other things need to be done before it.
|
||||
self:_afterNotCharging()
|
||||
if Device.screen_saver_mode then
|
||||
@@ -322,7 +336,7 @@ function UIManager:init()
|
||||
MassStorage:start()
|
||||
end
|
||||
end
|
||||
self.event_handlers["USbPlugOut"] = function()
|
||||
self.event_handlers["UsbPlugOut"] = function()
|
||||
self:_afterNotCharging()
|
||||
if Device.screen_saver_mode then
|
||||
self:suspend()
|
||||
|
||||
Reference in New Issue
Block a user