FileDocCategorySizeDatePackage
LegacyVpnInfo.javaAPI DocAndroid 5.1 API2921Thu Mar 12 22:22:10 GMT 2015com.android.internal.net

LegacyVpnInfo

public class LegacyVpnInfo extends Object implements android.os.Parcelable
A simple container used to carry information of the ongoing legacy VPN. Internal use only.
hide

Fields Summary
private static final String
TAG
public static final int
STATE_DISCONNECTED
public static final int
STATE_INITIALIZING
public static final int
STATE_CONNECTING
public static final int
STATE_CONNECTED
public static final int
STATE_TIMEOUT
public static final int
STATE_FAILED
public String
key
public int
state
public android.app.PendingIntent
intent
public static final Parcelable.Creator
CREATOR
Constructors Summary
Methods Summary
public intdescribeContents()


    
       
        return 0;
    
public static intstateFromNetworkInfo(android.net.NetworkInfo info)
Return best matching {@link LegacyVpnInfo} state based on given {@link NetworkInfo}.


                    
         
        switch (info.getDetailedState()) {
            case CONNECTING:
                return STATE_CONNECTING;
            case CONNECTED:
                return STATE_CONNECTED;
            case DISCONNECTED:
                return STATE_DISCONNECTED;
            case FAILED:
                return STATE_FAILED;
            default:
                Log.w(TAG, "Unhandled state " + info.getDetailedState()
                        + " ; treating as disconnected");
                return STATE_DISCONNECTED;
        }
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeString(key);
        out.writeInt(state);
        out.writeParcelable(intent, flags);