I think there's a simpler way...use `onstatuschange` and `wifiManager.api.connection.status` instead.