FileDocCategorySizeDatePackage
CdmaCellLocation.javaAPI DocAndroid 5.1 API8796Thu Mar 12 22:22:42 GMT 2015android.telephony.cdma

CdmaCellLocation

public class CdmaCellLocation extends android.telephony.CellLocation
Represents the cell location on a CDMA phone.

Fields Summary
private int
mBaseStationId
public static final int
INVALID_LAT_LONG
private int
mBaseStationLatitude
Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. It is represented in units of 0.25 seconds and ranges from -1296000 to 1296000, both values inclusive (corresponding to a range of -90 to +90 degrees). Integer.MAX_VALUE is considered invalid value.
private int
mBaseStationLongitude
Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. It is represented in units of 0.25 seconds and ranges from -2592000 to 2592000, both values inclusive (corresponding to a range of -180 to +180 degrees). Integer.MAX_VALUE is considered invalid value.
private int
mSystemId
private int
mNetworkId
Constructors Summary
public CdmaCellLocation()
Empty constructor. Initializes the BID, SID, NID and base station latitude and longitude to invalid values.


                         
      
        this.mBaseStationId = -1;
        this.mBaseStationLatitude = INVALID_LAT_LONG;
        this.mBaseStationLongitude = INVALID_LAT_LONG;
        this.mSystemId = -1;
        this.mNetworkId = -1;
    
public CdmaCellLocation(android.os.Bundle bundle)
Initialize the object from a bundle.

        this.mBaseStationId = bundle.getInt("baseStationId", mBaseStationId);
        this.mBaseStationLatitude = bundle.getInt("baseStationLatitude", mBaseStationLatitude);
        this.mBaseStationLongitude = bundle.getInt("baseStationLongitude", mBaseStationLongitude);
        this.mSystemId = bundle.getInt("systemId", mSystemId);
        this.mNetworkId = bundle.getInt("networkId", mNetworkId);
    
Methods Summary
public static doubleconvertQuartSecToDecDegrees(int quartSec)
Converts latitude or longitude from 0.25 seconds (as defined in the 3GPP2 C.S0005-A v6.0 standard) to decimal degrees

param
quartSec latitude or longitude in 0.25 seconds units
return
latitude or longitude in decimal degrees units
throws
IllegalArgumentException if value is less than -2592000, greater than 2592000, or is not a number.

        if(Double.isNaN(quartSec) || quartSec < -2592000 || quartSec > 2592000){
            // Invalid value
            throw new IllegalArgumentException("Invalid coordiante value:" + quartSec);
        }
        return ((double)quartSec) / (3600 * 4);
    
public booleanequals(java.lang.Object o)

        CdmaCellLocation s;

        try {
            s = (CdmaCellLocation)o;
        } catch (ClassCastException ex) {
            return false;
        }

        if (o == null) {
            return false;
        }

        return (equalsHandlesNulls(this.mBaseStationId, s.mBaseStationId) &&
                equalsHandlesNulls(this.mBaseStationLatitude, s.mBaseStationLatitude) &&
                equalsHandlesNulls(this.mBaseStationLongitude, s.mBaseStationLongitude) &&
                equalsHandlesNulls(this.mSystemId, s.mSystemId) &&
                equalsHandlesNulls(this.mNetworkId, s.mNetworkId)
        );
    
private static booleanequalsHandlesNulls(java.lang.Object a, java.lang.Object b)
Test whether two objects hold the same data values or both are null

param
a first obj
param
b second obj
return
true if two objects equal or both are null

        return (a == null) ? (b == null) : a.equals (b);
    
public voidfillInNotifierBundle(android.os.Bundle bundleToFill)
Fill the cell location data into the intent notifier Bundle based on service state

param
bundleToFill intent notifier Bundle

        bundleToFill.putInt("baseStationId", this.mBaseStationId);
        bundleToFill.putInt("baseStationLatitude", this.mBaseStationLatitude);
        bundleToFill.putInt("baseStationLongitude", this.mBaseStationLongitude);
        bundleToFill.putInt("systemId", this.mSystemId);
        bundleToFill.putInt("networkId", this.mNetworkId);
    
public intgetBaseStationId()

return
cdma base station identification number, -1 if unknown

        return this.mBaseStationId;
    
public intgetBaseStationLatitude()
Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. (http://www.3gpp2.org/public_html/specs/C.S0005-A_v6.0.pdf) It is represented in units of 0.25 seconds and ranges from -1296000 to 1296000, both values inclusive (corresponding to a range of -90 to +90 degrees). Integer.MAX_VALUE is considered invalid value.

return
cdma base station latitude in units of 0.25 seconds, Integer.MAX_VALUE if unknown

        return this.mBaseStationLatitude;
    
public intgetBaseStationLongitude()
Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. (http://www.3gpp2.org/public_html/specs/C.S0005-A_v6.0.pdf) It is represented in units of 0.25 seconds and ranges from -2592000 to 2592000, both values inclusive (corresponding to a range of -180 to +180 degrees). Integer.MAX_VALUE is considered invalid value.

return
cdma base station longitude in units of 0.25 seconds, Integer.MAX_VALUE if unknown

        return this.mBaseStationLongitude;
    
public intgetNetworkId()

return
cdma network identification number, -1 if unknown

        return this.mNetworkId;
    
public intgetSystemId()

return
cdma system identification number, -1 if unknown

        return this.mSystemId;
    
public inthashCode()

        return this.mBaseStationId ^ this.mBaseStationLatitude ^ this.mBaseStationLongitude
                ^ this.mSystemId ^ this.mNetworkId;
    
public booleanisEmpty()

hide

        return (this.mBaseStationId == -1 &&
                this.mBaseStationLatitude == INVALID_LAT_LONG &&
                this.mBaseStationLongitude == INVALID_LAT_LONG &&
                this.mSystemId == -1 &&
                this.mNetworkId == -1);
    
public voidsetCellLocationData(int baseStationId, int baseStationLatitude, int baseStationLongitude, int systemId, int networkId)
Set the cell location data.

         // The following values have to be written in the correct sequence
         this.mBaseStationId = baseStationId;
         this.mBaseStationLatitude = baseStationLatitude;   //values[2];
         this.mBaseStationLongitude = baseStationLongitude; //values[3];
         this.mSystemId = systemId;
         this.mNetworkId = networkId;
    
public voidsetCellLocationData(int baseStationId, int baseStationLatitude, int baseStationLongitude)
Set the cell location data.

         // The following values have to be written in the correct sequence
         this.mBaseStationId = baseStationId;
         this.mBaseStationLatitude = baseStationLatitude;   //values[2];
         this.mBaseStationLongitude = baseStationLongitude; //values[3];
    
public voidsetStateInvalid()
Invalidate this object. The cell location data is set to invalid values.

        this.mBaseStationId = -1;
        this.mBaseStationLatitude = INVALID_LAT_LONG;
        this.mBaseStationLongitude = INVALID_LAT_LONG;
        this.mSystemId = -1;
        this.mNetworkId = -1;
    
public java.lang.StringtoString()

        return "[" + this.mBaseStationId + ","
                   + this.mBaseStationLatitude + ","
                   + this.mBaseStationLongitude + ","
                   + this.mSystemId + ","
                   + this.mNetworkId + "]";