2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
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.
2023-09-21 18:21:09 +02:00
..
archiveviewer.koplugin ArchiveViewer: view files (#10683) 2023-07-14 07:57:28 +03:00
autodim.koplugin PM: Optimize task queue handling around standby (#10203) 2023-04-05 20:54:47 +02:00
autofrontlight.koplugin UX: a set of minor fixes (#10165) 2023-02-28 09:19:17 +02:00
autostandby.koplugin [plugin] AutoStandby: Make "Update" string translatable (#9655) 2022-10-20 19:35:09 +02:00
autosuspend.koplugin NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 2023-09-21 18:21:09 +02:00
autoturn.koplugin PM: Optimize task queue handling around standby (#10203) 2023-04-05 20:54:47 +02:00
autowarmth.koplugin [AutoWarmth] use CheckButton for night mode toggle (#10762) 2023-08-03 01:01:38 +02:00
backgroundrunner.koplugin Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
batterystat.koplugin Duration format: add "Letters" format (1h30m10s) (#9924) 2023-02-12 23:22:11 +01:00
bookshortcuts.koplugin Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
calibre.koplugin Calibre: Add reading status to the metadata search popups (#10842) 2023-08-26 16:13:59 +02:00
coverbrowser.koplugin Custom metadata: fixes (#10889) 2023-09-12 07:54:38 +03:00
coverimage.koplugin CoverImage: custom cover support (#10553) 2023-06-09 10:36:34 +03:00
docsettingtweak.koplugin copt deduplicate: font_size, visible_pages (#10882) 2023-09-09 09:24:05 +03:00
exporter.koplugin Exporter: custom metadata (#10874) 2023-09-05 07:42:18 +03:00
externalkeyboard.koplugin ExternalKeyboard: make metadata capitalization abide by styleguide (#10081) 2023-02-12 23:27:00 +01:00
gestures.koplugin QuickMenu: add long-press on profile (#10671) 2023-07-28 18:10:35 +03:00
hello.koplugin Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
japanese.koplugin Cleanup various varargs shenanigans (#9624) 2022-10-12 19:59:48 +02:00
keepalive.koplugin UX: a set of minor fixes (#10165) 2023-02-28 09:19:17 +02:00
kosync.koplugin NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863) 2023-09-21 18:21:09 +02:00
movetoarchive.koplugin MoveToArchive register to Dispatcher (#10524) 2023-06-02 18:55:22 +03:00
newsdownloader.koplugin NewsDownloader: avoid some crashes (#9697) 2022-11-07 18:21:50 +01:00
opds.koplugin TextViewer: font size (#10911) 2023-09-19 08:39:25 +03:00
patchmanagement.koplugin TextViewer: font size (#10911) 2023-09-19 08:39:25 +03:00
perceptionexpander.koplugin Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +02:00
profiles.koplugin copt deduplicate: render_dpi, margins, rotation_mode (#10880) 2023-09-08 08:41:44 +03:00
qrclipboard.koplugin Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
readtimer.koplugin ReadTimer: allow repeat when time is up (#9844) 2022-12-11 09:51:16 +01:00
SSH.koplugin SSH.koplugin: fix cant stop SSH server bug when pid file's stale (#10300) 2023-04-05 08:39:56 +02:00
statistics.koplugin Custom metadata: update Statistics db on metadata change (#10894) 2023-09-13 12:38:58 +02:00
systemstat.koplugin History: update last book access time (#10156) 2023-02-23 19:23:30 +02:00
terminal.koplugin MultiDialog: Fix an extremely nasty API misuse 2022-10-06 19:28:26 +02:00
texteditor.koplugin VirtualKeyboard: Revamp visibility handling (#10852) 2023-09-01 22:51:41 +02:00
timesync.koplugin Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
vocabbuilder.koplugin getProps: centralize 2 (#10837) 2023-08-30 07:53:59 +03:00
wallabag.koplugin [plugin] Wallabag: strip trailing slashes from server URL (#10715) 2023-07-27 09:29:29 +02:00