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/plugins
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.
9 months ago
..
SSH.koplugin SSH.koplugin: fix cant stop SSH server bug when pid file's stale (#10300) 1 year ago
archiveviewer.koplugin ArchiveViewer: view files (#10683) 11 months ago
autodim.koplugin PM: Optimize task queue handling around standby (#10203) 1 year ago
autofrontlight.koplugin UX: a set of minor fixes (#10165) 1 year ago
autostandby.koplugin [plugin] AutoStandby: Make "Update" string translatable (#9655) 2 years ago
autosuspend.koplugin NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 9 months ago
autoturn.koplugin PM: Optimize task queue handling around standby (#10203) 1 year ago
autowarmth.koplugin [AutoWarmth] use CheckButton for night mode toggle (#10762) 10 months ago
backgroundrunner.koplugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
batterystat.koplugin Duration format: add "Letters" format (1h30m10s) (#9924) 1 year ago
bookshortcuts.koplugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
calibre.koplugin Calibre: Add reading status to the metadata search popups (#10842) 10 months ago
coverbrowser.koplugin Custom metadata: fixes (#10889) 9 months ago
coverimage.koplugin CoverImage: custom cover support (#10553) 1 year ago
docsettingtweak.koplugin copt deduplicate: font_size, visible_pages (#10882) 9 months ago
exporter.koplugin Exporter: custom metadata (#10874) 9 months ago
externalkeyboard.koplugin ExternalKeyboard: make metadata capitalization abide by styleguide (#10081) 1 year ago
gestures.koplugin QuickMenu: add long-press on profile (#10671) 11 months ago
hello.koplugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
japanese.koplugin Cleanup various varargs shenanigans (#9624) 2 years ago
keepalive.koplugin UX: a set of minor fixes (#10165) 1 year ago
kosync.koplugin NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 9 months ago
movetoarchive.koplugin MoveToArchive register to Dispatcher (#10524) 1 year ago
newsdownloader.koplugin NewsDownloader: avoid some crashes (#9697) 2 years ago
opds.koplugin TextViewer: font size (#10911) 9 months ago
patchmanagement.koplugin TextViewer: font size (#10911) 9 months ago
perceptionexpander.koplugin Optimization: Use constant folding for divisions not a power of two (#9609) 2 years ago
profiles.koplugin copt deduplicate: render_dpi, margins, rotation_mode (#10880) 9 months ago
qrclipboard.koplugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
readtimer.koplugin ReadTimer: allow repeat when time is up (#9844) 2 years ago
statistics.koplugin Custom metadata: update Statistics db on metadata change (#10894) 9 months ago
systemstat.koplugin History: update last book access time (#10156) 1 year ago
terminal.koplugin MultiDialog: Fix an extremely nasty API misuse 2 years ago
texteditor.koplugin VirtualKeyboard: Revamp visibility handling (#10852) 9 months ago
timesync.koplugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
vocabbuilder.koplugin getProps: centralize 2 (#10837) 9 months ago
wallabag.koplugin [plugin] Wallabag: strip trailing slashes from server URL (#10715) 11 months ago