What is the suspended state in network

android, networking

Solution

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).

Problem

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.?

Original source