Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the suspended state in network

I am working on a xmpp project for Android device. Where I am to manage the xmpp connection. The connection is created and reconnected on connection lost. I saw some code where they managed the "suspended" state provided by ConnectivityReceiver class. So could anybody tell me when that suspended state comes.?

like image 443
Rahul Rastogi Avatar asked Feb 08 '14 10:02

Rahul Rastogi


2 Answers

The connected state indicates that your phone is connected and should be able to access IP traffic. The suspended state indicates that your IP traffic is temporarily unavailable but you are still connected.

An example from the TelephonyManager is when you have access to a 2G network and you receive a phone call, the data traffic may be suspended.

Here is the android documentation about the suspended state inside NetworkInfo who, i guess, happens in a similar case as the previous TelephonyManager example (data traffic required by other top level service).

like image 156
calimbak Avatar answered Nov 04 '22 04:11

calimbak


In addition to the answer already given: the mobile network is set to suspended while approving a captive Wi-Fi network.

Another interesting thing is that networks are set to blocked after one minute when the option 'Block connections without VPN' is enabled (Android Oreo and later).

like image 26
M66B Avatar answered Nov 04 '22 04:11

M66B