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/ui
NiLuJe 96850c23a0
NetworkMgr: Refine isConnected check (#10098)
Much easier to deal with thanks to the cleanup work done in #10062 ;).

* `carrier` is set to 1 as soon as the device is *administratively* up (in practice, as soon as we run `ifconfig up`). This is perfectly fine for `isWifiOn`, but absolutely not for `isConnected`, because we are not, actually, connected to *anything*, no attempt at associating has even been made at that point. Besides being semantically wrong, in practice, this will horribly break the connectivity check, because it expects that `isConnected` means we can talk to at least the LAN.
* Delving into the Linux docs reveals that `operstate` looks like a better candidate, as it reflects *operational status*; for Wi-Fi, that means associated and successfully authenticated. That's... closer, but still not it, because we still don't have an IP, so we technically can't talk to anything other than the AP.
* So, I've brought out the big guns (`getifaddrs`), and replicated a bit of code that I already use in the USBNetwork hack on Kindle, to detect whether we actually have an IP assigned. (Other approaches, like `/proc/net/route`, may not be entirely fool-proof, and/or get complicated when IPv6 enters the fray (which it does, on Kobo, Mk. 8+ devices are IPv6-enabled)).

TL;DR: Bunch of C via ffi, and `isConnected` now returns true only when the device is operationally up *and* we have an IP assigned.

Pulls in https://github.com/koreader/koreader-base/pull/1579 & https://github.com/koreader/lj-wpaclient/pull/10
1 year ago
..
data Keyboard: add Ukrainian virtual keyboard (#10037) 1 year ago
elements patch management 1 year ago
message Calibre: Log errors on wireless connection failures (#9914) 2 years ago
network NetworkMgr: Refine isConnected check (#10098) 1 year ago
plugin Clarify our OOP semantics across the codebase (#9586) 2 years ago
widget Notification: Fence the *display* update in an attempt to avoid upsetting some boards... (#10083) 1 year ago
bidi.lua Bidi: keep invert() generic, handle settings in ReaderView (#8876) 2 years ago
downloadmgr.lua CloudStorage: remove cloudmgr (#9532) 2 years ago
event.lua Cleanup various varargs shenanigans (#9624) 2 years ago
font.lua UI font fallbacks: use bold fonts if present for bold (#9621) 2 years ago
geometry.lua ImageViewer: Followup to #9529 (#9544) 2 years ago
gesturerange.lua [feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2 years ago
hook_container.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
language.lua [i18n] Enable Farsi (#10017) 1 year ago
menusorter.lua [fix] MenuSorter: use orderedPairs for orphans (#6403) 4 years ago
otamanager.lua OTAManager: pick the right binaries on Android x86_64 1 year ago
quickstart.lua Quick start guide: fix links to images (#8072) 3 years ago
renderimage.lua Misc: Get rid of the legacy defaults.lua globals (#9546) 2 years ago
rendertext.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
screensaver.lua Screensaver: correct access to doc settings (#10105) 1 year ago
size.lua [RFC] Pagination UI shenanigans (#7335) 3 years ago
time.lua time: Fix another subtle FP issue in split_s_us 2 years ago
translator.lua Misc: Unify error logging on network errors (#9523) 2 years ago
trapper.lua Cleanup various varargs shenanigans (#9624) 2 years ago
uimanager.lua ReaderFooter/Header: Refine autorefresh repaint-or-not checks (#10045) 1 year ago
wikipedia.lua Logger: Use serpent instead of dump (#9588) 2 years ago