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) ;).
reviewable/pr9739/r1
NiLuJe 2 years ago
parent 9863a9c0bb
commit 02020176a9

@ -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)

Loading…
Cancel
Save