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.?
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).
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With