mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script I was somehow convinced I'd already done that... While we're there, explain why we need to siphon those specific vars * Fix a stray eth0 -> $INTERFACE * Be very very sure we have INTERFACE set in our env re #3936 * Make getFirmwareVersion less fragile on Kobo Not that we actually use it right now, but, still. :D * Use the same syntax as the PRODUCT check * Actually implement getProductId Instead of a stray c/p ^^ * Properly identify the Rev2/Mark7 variants of existing devices Namely, the H2O² and Aura SE Not that the H2O²r2 support is still broken, this just allows us to implement it cleanyl without breaking handling of the original H2O² re #3925 * Tweak sleeps a bit around Kobo WiFi modules... See if that jog things up (re #3936) * Try harder not to suspend with WiFi on on Kobos Because otherwise, things go boom. (re #3936)
This commit is contained in:
@@ -142,7 +142,12 @@ function Device:onPowerEvent(ev)
|
||||
self.screen_saver_mode = true
|
||||
UIManager:scheduleIn(0.1, function()
|
||||
local network_manager = require("ui/network/manager")
|
||||
if network_manager.wifi_was_on then
|
||||
-- NOTE: wifi_was_on does not necessarily mean that WiFi is *currently* on! It means *we* enabled it.
|
||||
-- This is critical on Kobos (c.f., #3936), where it might still be on from KSM or Nickel,
|
||||
-- without us being aware of it (i.e., wifi_was_on still unset or false),
|
||||
-- because suspend will at best fail, and at worst deadlock the system if WiFi is on,
|
||||
-- regardless of who enabled it!
|
||||
if network_manager.wifi_was_on or network_manager:isWifiOn() then
|
||||
network_manager:releaseIP()
|
||||
network_manager:turnOffWifi()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user