FileDocCategorySizeDatePackage
LinkQualityInfo.javaAPI DocAndroid 5.1 API8782Thu Mar 12 22:22:10 GMT 2015android.net

LinkQualityInfo

public class LinkQualityInfo extends Object implements android.os.Parcelable
Class that represents useful attributes of generic network links such as the upload/download throughput or packet error rate. Generally speaking, you should be dealing with instances of LinkQualityInfo subclasses, such as {@link android.net.#WifiLinkQualityInfo} or {@link android.net.#MobileLinkQualityInfo} which provide additional information.
hide

Fields Summary
public static final int
UNKNOWN_INT
Represents a value that you can use to test if an integer field is set to a good value
public static final long
UNKNOWN_LONG
Represents a value that you can use to test if a long field is set to a good value
public static final int
NORMALIZED_MIN_SIGNAL_STRENGTH
public static final int
NORMALIZED_MAX_SIGNAL_STRENGTH
public static final int
NORMALIZED_SIGNAL_STRENGTH_RANGE
private int
mNetworkType
private int
mNormalizedSignalStrength
private long
mPacketCount
private long
mPacketErrorCount
private int
mTheoreticalTxBandwidth
private int
mTheoreticalRxBandwidth
private int
mTheoreticalLatency
private long
mLastDataSampleTime
private int
mDataSampleDuration
protected static final int
OBJECT_TYPE_LINK_QUALITY_INFO
Implement the Parcelable interface.
protected static final int
OBJECT_TYPE_WIFI_LINK_QUALITY_INFO
protected static final int
OBJECT_TYPE_MOBILE_LINK_QUALITY_INFO
public static final Creator
CREATOR
Constructors Summary
public LinkQualityInfo()


      

    
Methods Summary
public intdescribeContents()
Implement the Parcelable interface

hide

        return 0;
    
public intgetDataSampleDuration()
returns the sample duration used

return
duration in milliseconds or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mDataSampleDuration;
    
public longgetLastDataSampleTime()
returns the time stamp of the last sample

return
milliseconds elapsed since start and sample time or {@link android.net.LinkQualityInfo#UNKNOWN_LONG}

        return mLastDataSampleTime;
    
public intgetNetworkType()
returns the type of network this link is connected to

return
network type as defined by {@link android.net.ConnectivityManager} or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mNetworkType;
    
public intgetNormalizedSignalStrength()
returns the signal strength normalized across multiple types of networks

return
an integer value from 0 - 99 or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mNormalizedSignalStrength;
    
public longgetPacketCount()
returns the total number of packets sent or received in sample duration

return
number of packets or {@link android.net.LinkQualityInfo#UNKNOWN_LONG}

        return mPacketCount;
    
public longgetPacketErrorCount()
returns the total number of packets errors encountered in sample duration

return
number of errors or {@link android.net.LinkQualityInfo#UNKNOWN_LONG}

        return mPacketErrorCount;
    
public intgetTheoreticalLatency()
returns the theoretical latency of this network

return
latency in milliseconds or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mTheoreticalLatency;
    
public intgetTheoreticalRxBandwidth()
returns the theoretical download bandwidth of this network

return
bandwidth in Kbps or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mTheoreticalRxBandwidth;
    
public intgetTheoreticalTxBandwidth()
returns the theoretical upload bandwidth of this network

return
bandwidth in Kbps or {@link android.net.LinkQualityInfo#UNKNOWN_INT}

        return mTheoreticalTxBandwidth;
    
protected voidinitializeFromParcel(android.os.Parcel in)

hide


          
        
        mNetworkType = in.readInt();
        mNormalizedSignalStrength = in.readInt();
        mPacketCount = in.readLong();
        mPacketErrorCount = in.readLong();
        mTheoreticalTxBandwidth = in.readInt();
        mTheoreticalRxBandwidth = in.readInt();
        mTheoreticalLatency = in.readInt();
        mLastDataSampleTime = in.readLong();
        mDataSampleDuration = in.readInt();
    
public voidsetDataSampleDuration(int dataSampleDuration)

hide

        mDataSampleDuration = dataSampleDuration;
    
public voidsetLastDataSampleTime(long lastDataSampleTime)

hide

        mLastDataSampleTime = lastDataSampleTime;
    
public voidsetNetworkType(int networkType)

hide

        mNetworkType = networkType;
    
public voidsetNormalizedSignalStrength(int normalizedSignalStrength)

hide

        mNormalizedSignalStrength = normalizedSignalStrength;
    
public voidsetPacketCount(long packetCount)

hide

        mPacketCount = packetCount;
    
public voidsetPacketErrorCount(long packetErrorCount)

hide

        mPacketErrorCount = packetErrorCount;
    
public voidsetTheoreticalLatency(int theoreticalLatency)

hide

        mTheoreticalLatency = theoreticalLatency;
    
public voidsetTheoreticalRxBandwidth(int theoreticalRxBandwidth)

hide

        mTheoreticalRxBandwidth = theoreticalRxBandwidth;
    
public voidsetTheoreticalTxBandwidth(int theoreticalTxBandwidth)

hide

        mTheoreticalTxBandwidth = theoreticalTxBandwidth;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

hide


          
          
        writeToParcel(dest, flags, OBJECT_TYPE_LINK_QUALITY_INFO);
    
public voidwriteToParcel(android.os.Parcel dest, int flags, int objectType)

hide

        dest.writeInt(objectType);
        dest.writeInt(mNetworkType);
        dest.writeInt(mNormalizedSignalStrength);
        dest.writeLong(mPacketCount);
        dest.writeLong(mPacketErrorCount);
        dest.writeInt(mTheoreticalTxBandwidth);
        dest.writeInt(mTheoreticalRxBandwidth);
        dest.writeInt(mTheoreticalLatency);
        dest.writeLong(mLastDataSampleTime);
        dest.writeInt(mDataSampleDuration);