pull/36039/head
Shane Smiskol 4 days ago
parent 92c1c2a5fc
commit e237d9a720
  1. 19
      system/ui/lib/wifi_manager.py

@ -52,6 +52,13 @@ def get_security_type(flags: int, wpa_flags: int, rsn_flags: int) -> SecurityTyp
return SecurityType.UNSUPPORTED
def run_blocking(func: Callable, block: bool):
if block:
func()
else:
threading.Thread(target=func, daemon=True).start()
@dataclass(frozen=True)
class Network:
ssid: str
@ -319,11 +326,7 @@ class WifiManager:
if self._forgotten is not None:
self._forgotten(ssid)
# TODO: make a helper when it makes sense
if block:
worker()
else:
threading.Thread(target=worker, daemon=True).start()
run_blocking(worker, block)
def activate_connection(self, ssid: str, block: bool = False):
def worker():
@ -342,11 +345,7 @@ class WifiManager:
# if self._activated is not None:
# self._activated()
# TODO: make a helper when it makes sense
if block:
worker()
else:
threading.Thread(target=worker, daemon=True).start()
run_blocking(worker, block)
def _request_scan(self):
if self._wifi_device is None:

Loading…
Cancel
Save