mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-10 11:52:10 +08:00
@@ -67,11 +67,13 @@ def clear_locks(root):
|
||||
def is_on_wifi():
|
||||
# ConnectivityManager.getActiveNetworkInfo()
|
||||
try:
|
||||
# TODO: figure out why the android service call sometimes dies with SIGUSR2 (signal from MSGQ)
|
||||
result = android.parse_service_call_string(android.service_call(["connectivity", "2"]))
|
||||
if result is None:
|
||||
return True
|
||||
return 'WIFI' in result
|
||||
except (AttributeError, subprocess.CalledProcessError):
|
||||
cloudlog.exception("is_on_wifi failed")
|
||||
return False
|
||||
|
||||
def is_on_hotspot():
|
||||
|
||||
Reference in New Issue
Block a user