mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ExternalKeyboard: Only disable OTG on exit
We currently did so on plugin destruction, which was a bit overkill/annoying, as plugin instances are torn down on view changes (i.e., when FileManager/ReaderUI are torn down) ;).
This commit is contained in:
@@ -204,12 +204,8 @@ end
|
||||
|
||||
function ExternalKeyboard:setOTGRole(role) end
|
||||
|
||||
-- Keep in mind this fires every time we tear down the FM or Reader, too.
|
||||
-- Then again, so does init when the new view spins up,
|
||||
-- which ensures everything works out when switching between the FM & the Reader,
|
||||
-- as long as `external_keyboard_otg_mode_on_start` is enabled.
|
||||
function ExternalKeyboard:onCloseWidget()
|
||||
logger.dbg("ExternalKeyboard:onCloseWidget")
|
||||
function ExternalKeyboard:onExit()
|
||||
logger.dbg("ExternalKeyboard:onExit")
|
||||
local role = self:getOTGRole()
|
||||
if role == USB_ROLE_HOST then
|
||||
self:setOTGRole(USB_ROLE_DEVICE)
|
||||
|
||||
Reference in New Issue
Block a user