You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koreader/frontend/device
NiLuJe 34ba2fab30
NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863)
* Device: Add a `hasSeamlessWifiToggle` devcap to complement `hasWifiToggle`, to denote platforms where we can toggle WiFi without losing focus, as this has obvious UX impacts, and less obvious technical impacts on some of the NetworkMgr innards...
* Android: Mark as `!hasSeamlessWifiToggle`, as it requires losing focus to the system settings. Moreover, `turnOnWifi` returns *immediately* and we *still* run in the background during that time, for extra spiciness...
* NetworkMgr: Ensure only *one* call to `turnOnWifi` will actually go on when stuff gets re-scheduled by the `beforeWifiAction` framework.
* NetworkMgr: Ensure the `beforeWifiAction` framework will not re-schedule the same thing *ad vitam aeternam* if a previous connection attempt is still ongoing. (i.e., previously, on Android, if you backed out of the system settings, you entered the Benny Hill dimension, as NetworkMgr would keep throwing you back into the system settings ;p). This has a few implications on callbacks requested by subsequent connection attempts, though. Generally, we'll try to honor *explicitly interactive* callbacks, but `beforeWifiAction` stuff will be dropped (only the original cb is preserved). That's what prevents the aforementioned infinite loop, as the `beforeWifiAction` framework was based on the assumption that `turnOnWifi` somewhat guaranteed `isConnected` to be true on return, something which is only actually true on `hasWifiManager` platforms.
* NetworkMgr: In `prompt` mode, the above implies that the prompt will not even be shown for concurrent attempts, as it's otherwise extremely confusing (KOSync on Android being a prime example, as it has a pair of Suspend/Resume handlers, so the initial attempt trips those two because of the focus switch >_<").
* NetworkMgr: Don't attempt to kill wifi when aborting a connection attempt on `!hasSeamlessWifiToggle` (because, again, it'll break UX, and also because it might run at very awkward times (e.g., I managed to go back to KOReader *between* a FM/Reader switch at one point, which promptly caused `UIManager` to exit because there was nothing to show ;p).
* NetworkMgr: Don't drop the connectivity callback when `beforeWifiAction` is set to prompt and the target happens to use a connectivity check in its `turnOnWifi` implementation (e.g., on Kindle).
* Android: Add an `"ignore"` `beforeWifiAction` mode, that'll do nothing but schedule the connectivity check with its callback (with the intent being the system will eventually enable wifi on its own Soon(TM)). If you're already online, the callback will run immediately, obviously. If you followed the early discussions on this PR, this closely matches what happens on `!hasWifiToggle` platforms (as flagging Android that way was one of the possible approaches here).
* NetworkMgr: Bail out early in `goOnlineToRun` if `beforeWifiAction` isn't `"turn_on"`. Prompt cannot work there, and while ignore technically could, it would serve very little purpose given its intended use case.
* KOSync: Neuter the Resume/Suspend handlers early on `CloseDocument`, as this is how focus switches are handled on Android, and if `beforeWifiAction` is `turn_on` and you were offline at the time, we'd trip them because of the swap to system settings to enable wifi.
* KOSync: Allow `auto_sync` to be enabled regardless of the `beforeWifiAction` mode on `!hasSeamlessWifiToggle` platforms. Prompt is still a terrible idea, but given that `goOnlineToRun` now aborts early if the mode is not supported, it's less of a problem.
8 months ago
..
android NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 8 months ago
cervantes NetworkManager: Allow backends to report connection failures early 10 months ago
dummy Clarify our OOP semantics across the codebase (#9586) 2 years ago
generic NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 8 months ago
kindle Kobo: Yet another attempt at working around the hangs on the latest NXP boards (#10771) 10 months ago
kobo AutoSuspend: Handle a few corner-cases better (#10797) 9 months ago
pocketbook PocketBook: Run Generic:exit *last* 9 months ago
remarkable NetworkManager: Allow backends to report connection failures early 10 months ago
sdl Never export LD_LIBRARY_PATH 11 months ago
sony-prstux NetworkManager: Allow backends to report connection failures early 10 months ago
devicelistener.lua Misc: Review pass on the previous commits 10 months ago
gesturedetector.lua GestureDetector: Make two_finger pans & swipes report the same sort of data than their standard brethren (#10649) 11 months ago
input.lua Kobo: Fix the input translation on the Elipsa 2E (#10802) 10 months ago
key.lua InputContainer: Fall cleanup ;). 2 years ago
sysfs_light.lua Kobo: Yet another attempt at working around the hangs on the latest NXP boards (#10771) 10 months ago
thirdparty.lua Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785) 3 years ago
wakeupmgr.lua WakeupMgr: Explicitly invalidate the current alarm in unsetWakeupAlarm (#10032) 1 year ago