Merge "Define CellInfo.UNAVAILABLE for Unreported Fields" am: 40745e1def
am: ae7dd94d7f
Change-Id: I7491584dfba8ccfa8f9835623f766a87268ae1d3
This commit is contained in:
@@ -42189,6 +42189,7 @@ package android.telephony {
|
|||||||
field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
|
field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
|
||||||
field public static final int CONNECTION_UNKNOWN = 2147483647; // 0x7fffffff
|
field public static final int CONNECTION_UNKNOWN = 2147483647; // 0x7fffffff
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.CellInfo> CREATOR;
|
field public static final android.os.Parcelable.Creator<android.telephony.CellInfo> CREATOR;
|
||||||
|
field public static final int UNAVAILABLE = 2147483647; // 0x7fffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class CellInfoCdma extends android.telephony.CellInfo implements android.os.Parcelable {
|
public final class CellInfoCdma extends android.telephony.CellInfo implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.telephony;
|
package android.telephony;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.telephony.cdma.CdmaCellLocation;
|
import android.telephony.cdma.CdmaCellLocation;
|
||||||
@@ -56,11 +55,11 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
public CellIdentityCdma() {
|
public CellIdentityCdma() {
|
||||||
super(TAG, CellInfo.TYPE_CDMA, null, null, null, null);
|
super(TAG, CellInfo.TYPE_CDMA, null, null, null, null);
|
||||||
mNetworkId = Integer.MAX_VALUE;
|
mNetworkId = CellInfo.UNAVAILABLE;
|
||||||
mSystemId = Integer.MAX_VALUE;
|
mSystemId = CellInfo.UNAVAILABLE;
|
||||||
mBasestationId = Integer.MAX_VALUE;
|
mBasestationId = CellInfo.UNAVAILABLE;
|
||||||
mLongitude = Integer.MAX_VALUE;
|
mLongitude = CellInfo.UNAVAILABLE;
|
||||||
mLatitude = Integer.MAX_VALUE;
|
mLatitude = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +103,7 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
mLongitude = lon;
|
mLongitude = lon;
|
||||||
mLatitude = lat;
|
mLatitude = lat;
|
||||||
} else {
|
} else {
|
||||||
mLongitude = mLatitude = Integer.MAX_VALUE;
|
mLongitude = mLatitude = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,21 +129,24 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Network Id 0..65535, Integer.MAX_VALUE if unknown
|
* @return Network Id 0..65535, {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE}
|
||||||
|
* if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getNetworkId() {
|
public int getNetworkId() {
|
||||||
return mNetworkId;
|
return mNetworkId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return System Id 0..32767, Integer.MAX_VALUE if unknown
|
* @return System Id 0..32767, {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE}
|
||||||
|
* if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getSystemId() {
|
public int getSystemId() {
|
||||||
return mSystemId;
|
return mSystemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Base Station Id 0..65535, Integer.MAX_VALUE if unknown
|
* @return Base Station Id 0..65535, {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE}
|
||||||
|
* if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getBasestationId() {
|
public int getBasestationId() {
|
||||||
return mBasestationId;
|
return mBasestationId;
|
||||||
@@ -155,7 +157,7 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
* specified in 3GPP2 C.S0005-A v6.0. It is represented in units
|
* specified in 3GPP2 C.S0005-A v6.0. It is represented in units
|
||||||
* of 0.25 seconds and ranges from -2592000 to 2592000, both
|
* of 0.25 seconds and ranges from -2592000 to 2592000, both
|
||||||
* values inclusive (corresponding to a range of -180
|
* values inclusive (corresponding to a range of -180
|
||||||
* to +180 degrees). Integer.MAX_VALUE if unknown.
|
* to +180 degrees). {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getLongitude() {
|
public int getLongitude() {
|
||||||
return mLongitude;
|
return mLongitude;
|
||||||
@@ -166,7 +168,7 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
* specified in 3GPP2 C.S0005-A v6.0. It is represented in units
|
* specified in 3GPP2 C.S0005-A v6.0. It is represented in units
|
||||||
* of 0.25 seconds and ranges from -1296000 to 1296000, both
|
* of 0.25 seconds and ranges from -1296000 to 1296000, both
|
||||||
* values inclusive (corresponding to a range of -90
|
* values inclusive (corresponding to a range of -90
|
||||||
* to +90 degrees). Integer.MAX_VALUE if unknown.
|
* to +90 degrees). {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getLatitude() {
|
public int getLatitude() {
|
||||||
return mLatitude;
|
return mLatitude;
|
||||||
@@ -182,10 +184,10 @@ public final class CellIdentityCdma extends CellIdentity {
|
|||||||
@Override
|
@Override
|
||||||
public CdmaCellLocation asCellLocation() {
|
public CdmaCellLocation asCellLocation() {
|
||||||
CdmaCellLocation cl = new CdmaCellLocation();
|
CdmaCellLocation cl = new CdmaCellLocation();
|
||||||
int bsid = mBasestationId != Integer.MAX_VALUE ? mBasestationId : -1;
|
int bsid = mBasestationId != CellInfo.UNAVAILABLE ? mBasestationId : -1;
|
||||||
int sid = mSystemId != Integer.MAX_VALUE ? mSystemId : -1;
|
int sid = mSystemId != CellInfo.UNAVAILABLE ? mSystemId : -1;
|
||||||
int nid = mNetworkId != Integer.MAX_VALUE ? mNetworkId : -1;
|
int nid = mNetworkId != CellInfo.UNAVAILABLE ? mNetworkId : -1;
|
||||||
// lat and long already use Integer.MAX_VALUE for invalid/unknown
|
// lat and long already use CellInfo.UNAVAILABLE for invalid/unknown
|
||||||
cl.setCellLocationData(bsid, mLatitude, mLongitude, sid, nid);
|
cl.setCellLocationData(bsid, mLatitude, mLongitude, sid, nid);
|
||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.telephony;
|
package android.telephony;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.telephony.gsm.GsmCellLocation;
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
@@ -48,10 +47,10 @@ public final class CellIdentityGsm extends CellIdentity {
|
|||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public CellIdentityGsm() {
|
public CellIdentityGsm() {
|
||||||
super(TAG, CellInfo.TYPE_GSM, null, null, null, null);
|
super(TAG, CellInfo.TYPE_GSM, null, null, null, null);
|
||||||
mLac = Integer.MAX_VALUE;
|
mLac = CellInfo.UNAVAILABLE;
|
||||||
mCid = Integer.MAX_VALUE;
|
mCid = CellInfo.UNAVAILABLE;
|
||||||
mArfcn = Integer.MAX_VALUE;
|
mArfcn = CellInfo.UNAVAILABLE;
|
||||||
mBsic = Integer.MAX_VALUE;
|
mBsic = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* public constructor
|
* public constructor
|
||||||
@@ -63,7 +62,7 @@ public final class CellIdentityGsm extends CellIdentity {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public CellIdentityGsm(int mcc, int mnc, int lac, int cid) {
|
public CellIdentityGsm(int mcc, int mnc, int lac, int cid) {
|
||||||
this(lac, cid, Integer.MAX_VALUE, Integer.MAX_VALUE,
|
this(lac, cid, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
|
||||||
String.valueOf(mcc), String.valueOf(mnc), null, null);
|
String.valueOf(mcc), String.valueOf(mnc), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +102,7 @@ public final class CellIdentityGsm extends CellIdentity {
|
|||||||
mArfcn = arfcn;
|
mArfcn = arfcn;
|
||||||
// In RIL BSIC is a UINT8, so 0xFF is the 'INVALID' designator
|
// In RIL BSIC is a UINT8, so 0xFF is the 'INVALID' designator
|
||||||
// for inbound parcels
|
// for inbound parcels
|
||||||
mBsic = (bsic == 0xFF) ? Integer.MAX_VALUE : bsic;
|
mBsic = (bsic == 0xFF) ? CellInfo.UNAVAILABLE : bsic;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CellIdentityGsm(CellIdentityGsm cid) {
|
private CellIdentityGsm(CellIdentityGsm cid) {
|
||||||
@@ -116,69 +115,73 @@ public final class CellIdentityGsm extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 3-digit Mobile Country Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 3-digit Mobile Country Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMccString} instead.
|
* @deprecated Use {@link #getMccString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMcc() {
|
public int getMcc() {
|
||||||
return (mMccStr != null) ? Integer.valueOf(mMccStr) : Integer.MAX_VALUE;
|
return (mMccStr != null) ? Integer.valueOf(mMccStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 2 or 3-digit Mobile Network Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 2 or 3-digit Mobile Network Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMncString} instead.
|
* @deprecated Use {@link #getMncString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMnc() {
|
public int getMnc() {
|
||||||
return (mMncStr != null) ? Integer.valueOf(mMncStr) : Integer.MAX_VALUE;
|
return (mMncStr != null) ? Integer.valueOf(mMncStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit Location Area Code, 0..65535, Integer.MAX_VALUE if unknown
|
* @return 16-bit Location Area Code, 0..65535,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getLac() {
|
public int getLac() {
|
||||||
return mLac;
|
return mLac;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return CID
|
* @return 16-bit GSM Cell Identity described in TS 27.007, 0..65535,
|
||||||
* Either 16-bit GSM Cell Identity described
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* in TS 27.007, 0..65535, Integer.MAX_VALUE if unknown
|
|
||||||
*/
|
*/
|
||||||
public int getCid() {
|
public int getCid() {
|
||||||
return mCid;
|
return mCid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit GSM Absolute RF Channel Number, Integer.MAX_VALUE if unknown
|
* @return 16-bit GSM Absolute RF Channel Number,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getArfcn() {
|
public int getArfcn() {
|
||||||
return mArfcn;
|
return mArfcn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 6-bit Base Station Identity Code, Integer.MAX_VALUE if unknown
|
* @return 6-bit Base Station Identity Code,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getBsic() {
|
public int getBsic() {
|
||||||
return mBsic;
|
return mBsic;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a 5 or 6 character string (MCC+MNC), null if any field is unknown
|
* @return a 5 or 6 character string (MCC+MNC), null if any field is unknown.
|
||||||
*/
|
*/
|
||||||
public String getMobileNetworkOperator() {
|
public String getMobileNetworkOperator() {
|
||||||
return (mMccStr == null || mMncStr == null) ? null : mMccStr + mMncStr;
|
return (mMccStr == null || mMncStr == null) ? null : mMccStr + mMncStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Country Code in string format, null if unknown
|
* @return Mobile Country Code in string format, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMccString() {
|
public String getMccString() {
|
||||||
return mMccStr;
|
return mMccStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Network Code in string format, null if unknown
|
* @return Mobile Network Code in string format, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMncString() {
|
public String getMncString() {
|
||||||
return mMncStr;
|
return mMncStr;
|
||||||
@@ -192,19 +195,19 @@ public final class CellIdentityGsm extends CellIdentity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Primary Scrambling Code is not applicable to GSM.
|
* @deprecated Primary Scrambling Code is not applicable to GSM.
|
||||||
* @return Integer.MAX_VALUE, undefined for GSM
|
* @return {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} - undefined for GSM
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getPsc() {
|
public int getPsc() {
|
||||||
return Integer.MAX_VALUE;
|
return CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public GsmCellLocation asCellLocation() {
|
public GsmCellLocation asCellLocation() {
|
||||||
GsmCellLocation cl = new GsmCellLocation();
|
GsmCellLocation cl = new GsmCellLocation();
|
||||||
int lac = mLac != Integer.MAX_VALUE ? mLac : -1;
|
int lac = mLac != CellInfo.UNAVAILABLE ? mLac : -1;
|
||||||
int cid = mCid != Integer.MAX_VALUE ? mCid : -1;
|
int cid = mCid != CellInfo.UNAVAILABLE ? mCid : -1;
|
||||||
cl.setLacAndCid(lac, cid);
|
cl.setLacAndCid(lac, cid);
|
||||||
cl.setPsc(-1);
|
cl.setPsc(-1);
|
||||||
return cl;
|
return cl;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.telephony;
|
package android.telephony;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.telephony.gsm.GsmCellLocation;
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
@@ -49,11 +48,11 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public CellIdentityLte() {
|
public CellIdentityLte() {
|
||||||
super(TAG, CellInfo.TYPE_LTE, null, null, null, null);
|
super(TAG, CellInfo.TYPE_LTE, null, null, null, null);
|
||||||
mCi = Integer.MAX_VALUE;
|
mCi = CellInfo.UNAVAILABLE;
|
||||||
mPci = Integer.MAX_VALUE;
|
mPci = CellInfo.UNAVAILABLE;
|
||||||
mTac = Integer.MAX_VALUE;
|
mTac = CellInfo.UNAVAILABLE;
|
||||||
mEarfcn = Integer.MAX_VALUE;
|
mEarfcn = CellInfo.UNAVAILABLE;
|
||||||
mBandwidth = Integer.MAX_VALUE;
|
mBandwidth = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +67,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac) {
|
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac) {
|
||||||
this(ci, pci, tac, Integer.MAX_VALUE, Integer.MAX_VALUE, String.valueOf(mcc),
|
this(ci, pci, tac, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, String.valueOf(mcc),
|
||||||
String.valueOf(mnc), null, null);
|
String.valueOf(mnc), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +83,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac, int earfcn) {
|
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac, int earfcn) {
|
||||||
this(ci, pci, tac, earfcn, Integer.MAX_VALUE, String.valueOf(mcc), String.valueOf(mnc),
|
this(ci, pci, tac, earfcn, CellInfo.UNAVAILABLE, String.valueOf(mcc), String.valueOf(mnc),
|
||||||
null, null);
|
null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,74 +121,81 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 3-digit Mobile Country Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 3-digit Mobile Country Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMccString} instead.
|
* @deprecated Use {@link #getMccString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMcc() {
|
public int getMcc() {
|
||||||
return (mMccStr != null) ? Integer.valueOf(mMccStr) : Integer.MAX_VALUE;
|
return (mMccStr != null) ? Integer.valueOf(mMccStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 2 or 3-digit Mobile Network Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 2 or 3-digit Mobile Network Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMncString} instead.
|
* @deprecated Use {@link #getMncString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMnc() {
|
public int getMnc() {
|
||||||
return (mMncStr != null) ? Integer.valueOf(mMncStr) : Integer.MAX_VALUE;
|
return (mMncStr != null) ? Integer.valueOf(mMncStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 28-bit Cell Identity, Integer.MAX_VALUE if unknown
|
* @return 28-bit Cell Identity,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getCi() {
|
public int getCi() {
|
||||||
return mCi;
|
return mCi;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Physical Cell Id 0..503, Integer.MAX_VALUE if unknown
|
* @return Physical Cell Id 0..503,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getPci() {
|
public int getPci() {
|
||||||
return mPci;
|
return mPci;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit Tracking Area Code, Integer.MAX_VALUE if unknown
|
* @return 16-bit Tracking Area Code,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getTac() {
|
public int getTac() {
|
||||||
return mTac;
|
return mTac;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 18-bit Absolute RF Channel Number, Integer.MAX_VALUE if unknown
|
* @return 18-bit Absolute RF Channel Number,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getEarfcn() {
|
public int getEarfcn() {
|
||||||
return mEarfcn;
|
return mEarfcn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Cell bandwidth in kHz, Integer.MAX_VALUE if unknown
|
* @return Cell bandwidth in kHz,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getBandwidth() {
|
public int getBandwidth() {
|
||||||
return mBandwidth;
|
return mBandwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Country Code in string format, null if unknown
|
* @return Mobile Country Code in string format, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMccString() {
|
public String getMccString() {
|
||||||
return mMccStr;
|
return mMccStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Network Code in string format, null if unknown
|
* @return Mobile Network Code in string format, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMncString() {
|
public String getMncString() {
|
||||||
return mMncStr;
|
return mMncStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a 5 or 6 character string (MCC+MNC), null if any field is unknown
|
* @return a 5 or 6 character string (MCC+MNC), null if any field is unknown.
|
||||||
*/
|
*/
|
||||||
public String getMobileNetworkOperator() {
|
public String getMobileNetworkOperator() {
|
||||||
return (mMccStr == null || mMncStr == null) ? null : mMccStr + mMncStr;
|
return (mMccStr == null || mMncStr == null) ? null : mMccStr + mMncStr;
|
||||||
@@ -216,8 +222,8 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
@Override
|
@Override
|
||||||
public GsmCellLocation asCellLocation() {
|
public GsmCellLocation asCellLocation() {
|
||||||
GsmCellLocation cl = new GsmCellLocation();
|
GsmCellLocation cl = new GsmCellLocation();
|
||||||
int tac = mTac != Integer.MAX_VALUE ? mTac : -1;
|
int tac = mTac != CellInfo.UNAVAILABLE ? mTac : -1;
|
||||||
int cid = mCi != Integer.MAX_VALUE ? mCi : -1;
|
int cid = mCi != CellInfo.UNAVAILABLE ? mCi : -1;
|
||||||
cl.setLacAndCid(tac, cid);
|
cl.setLacAndCid(tac, cid);
|
||||||
cl.setPsc(0);
|
cl.setPsc(0);
|
||||||
return cl;
|
return cl;
|
||||||
|
|||||||
@@ -28,11 +28,12 @@ public final class CellIdentityTdscdma extends CellIdentity {
|
|||||||
private static final String TAG = CellIdentityTdscdma.class.getSimpleName();
|
private static final String TAG = CellIdentityTdscdma.class.getSimpleName();
|
||||||
private static final boolean DBG = false;
|
private static final boolean DBG = false;
|
||||||
|
|
||||||
// 16-bit Location Area Code, 0..65535, INT_MAX if unknown.
|
// 16-bit Location Area Code, 0..65535, CellInfo.UNAVAILABLE if unknown.
|
||||||
private final int mLac;
|
private final int mLac;
|
||||||
// 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown.
|
// 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, CellInfo.UNAVAILABLE
|
||||||
|
// if unknown.
|
||||||
private final int mCid;
|
private final int mCid;
|
||||||
// 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown.
|
// 8-bit Cell Parameters ID described in TS 25.331, 0..127, CellInfo.UNAVAILABLE if unknown.
|
||||||
private final int mCpid;
|
private final int mCpid;
|
||||||
// 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
// 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
||||||
private final int mUarfcn;
|
private final int mUarfcn;
|
||||||
@@ -42,18 +43,20 @@ public final class CellIdentityTdscdma extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
public CellIdentityTdscdma() {
|
public CellIdentityTdscdma() {
|
||||||
super(TAG, CellInfo.TYPE_TDSCDMA, null, null, null, null);
|
super(TAG, CellInfo.TYPE_TDSCDMA, null, null, null, null);
|
||||||
mLac = Integer.MAX_VALUE;
|
mLac = CellInfo.UNAVAILABLE;
|
||||||
mCid = Integer.MAX_VALUE;
|
mCid = CellInfo.UNAVAILABLE;
|
||||||
mCpid = Integer.MAX_VALUE;
|
mCpid = CellInfo.UNAVAILABLE;
|
||||||
mUarfcn = Integer.MAX_VALUE;
|
mUarfcn = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mcc 3-digit Mobile Country Code, 0..999
|
* @param mcc 3-digit Mobile Country Code, 0..999
|
||||||
* @param mnc 2 or 3-digit Mobile Network Code, 0..999
|
* @param mnc 2 or 3-digit Mobile Network Code, 0..999
|
||||||
* @param lac 16-bit Location Area Code, 0..65535, INT_MAX if unknown
|
* @param lac 16-bit Location Area Code, 0..65535, CellInfo.UNAVAILABLE if unknown
|
||||||
* @param cid 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown
|
* @param cid 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, CellInfo.
|
||||||
* @param cpid 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown
|
* UNAVAILABLE if unknown
|
||||||
|
* @param cpid 8-bit Cell Parameters ID described in TS 25.331, 0..127, CellInfo.UNAVAILABLE
|
||||||
|
* if unknown
|
||||||
* @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
* @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -65,9 +68,11 @@ public final class CellIdentityTdscdma extends CellIdentity {
|
|||||||
/**
|
/**
|
||||||
* @param mcc 3-digit Mobile Country Code in string format
|
* @param mcc 3-digit Mobile Country Code in string format
|
||||||
* @param mnc 2 or 3-digit Mobile Network Code in string format
|
* @param mnc 2 or 3-digit Mobile Network Code in string format
|
||||||
* @param lac 16-bit Location Area Code, 0..65535, INT_MAX if unknown
|
* @param lac 16-bit Location Area Code, 0..65535, CellInfo.UNAVAILABLE if unknown
|
||||||
* @param cid 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown
|
* @param cid 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455,
|
||||||
* @param cpid 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown
|
* CellInfo.UNAVAILABLE if unknown
|
||||||
|
* @param cpid 8-bit Cell Parameters ID described in TS 25.331, 0..127,
|
||||||
|
* CellInfo.UNAVAILABLE if unknown
|
||||||
* @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
* @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
|
||||||
* @param alphal long alpha Operator Name String or Enhanced Operator Name String
|
* @param alphal long alpha Operator Name String or Enhanced Operator Name String
|
||||||
* @param alphas short alpha Operator Name String or Enhanced Operator Name String
|
* @param alphas short alpha Operator Name String or Enhanced Operator Name String
|
||||||
@@ -116,21 +121,24 @@ public final class CellIdentityTdscdma extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit Location Area Code, 0..65535, INT_MAX if unknown
|
* @return 16-bit Location Area Code, 0..65535,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getLac() {
|
public int getLac() {
|
||||||
return mLac;
|
return mLac;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown
|
* @return 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getCid() {
|
public int getCid() {
|
||||||
return mCid;
|
return mCid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown
|
* @return 8-bit Cell Parameters ID described in TS 25.331, 0..127,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getCpid() {
|
public int getCpid() {
|
||||||
return mCpid;
|
return mCpid;
|
||||||
@@ -146,8 +154,8 @@ public final class CellIdentityTdscdma extends CellIdentity {
|
|||||||
@Override
|
@Override
|
||||||
public GsmCellLocation asCellLocation() {
|
public GsmCellLocation asCellLocation() {
|
||||||
GsmCellLocation cl = new GsmCellLocation();
|
GsmCellLocation cl = new GsmCellLocation();
|
||||||
int lac = mLac != Integer.MAX_VALUE ? mLac : -1;
|
int lac = mLac != CellInfo.UNAVAILABLE ? mLac : -1;
|
||||||
int cid = mCid != Integer.MAX_VALUE ? mCid : -1;
|
int cid = mCid != CellInfo.UNAVAILABLE ? mCid : -1;
|
||||||
cl.setLacAndCid(lac, cid);
|
cl.setLacAndCid(lac, cid);
|
||||||
cl.setPsc(-1); // There is no PSC for TD-SCDMA; not using this for CPI to stem shenanigans
|
cl.setPsc(-1); // There is no PSC for TD-SCDMA; not using this for CPI to stem shenanigans
|
||||||
return cl;
|
return cl;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.telephony;
|
package android.telephony;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.telephony.gsm.GsmCellLocation;
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
@@ -46,10 +45,10 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
public CellIdentityWcdma() {
|
public CellIdentityWcdma() {
|
||||||
super(TAG, CellInfo.TYPE_WCDMA, null, null, null, null);
|
super(TAG, CellInfo.TYPE_WCDMA, null, null, null, null);
|
||||||
mLac = Integer.MAX_VALUE;
|
mLac = CellInfo.UNAVAILABLE;
|
||||||
mCid = Integer.MAX_VALUE;
|
mCid = CellInfo.UNAVAILABLE;
|
||||||
mPsc = Integer.MAX_VALUE;
|
mPsc = CellInfo.UNAVAILABLE;
|
||||||
mUarfcn = Integer.MAX_VALUE;
|
mUarfcn = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* public constructor
|
* public constructor
|
||||||
@@ -62,7 +61,7 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public CellIdentityWcdma (int mcc, int mnc, int lac, int cid, int psc) {
|
public CellIdentityWcdma (int mcc, int mnc, int lac, int cid, int psc) {
|
||||||
this(lac, cid, psc, Integer.MAX_VALUE, String.valueOf(mcc), String.valueOf(mnc),
|
this(lac, cid, psc, CellInfo.UNAVAILABLE, String.valueOf(mcc), String.valueOf(mnc),
|
||||||
null, null);
|
null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,25 +112,28 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 3-digit Mobile Country Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 3-digit Mobile Country Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMccString} instead.
|
* @deprecated Use {@link #getMccString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMcc() {
|
public int getMcc() {
|
||||||
return (mMccStr != null) ? Integer.valueOf(mMccStr) : Integer.MAX_VALUE;
|
return (mMccStr != null) ? Integer.valueOf(mMccStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 2 or 3-digit Mobile Network Code, 0..999, Integer.MAX_VALUE if unknown
|
* @return 2 or 3-digit Mobile Network Code, 0..999,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
* @deprecated Use {@link #getMncString} instead.
|
* @deprecated Use {@link #getMncString} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getMnc() {
|
public int getMnc() {
|
||||||
return (mMncStr != null) ? Integer.valueOf(mMncStr) : Integer.MAX_VALUE;
|
return (mMncStr != null) ? Integer.valueOf(mMncStr) : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit Location Area Code, 0..65535, Integer.MAX_VALUE if unknown
|
* @return 16-bit Location Area Code, 0..65535,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getLac() {
|
public int getLac() {
|
||||||
return mLac;
|
return mLac;
|
||||||
@@ -139,29 +141,30 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return CID
|
* @return CID
|
||||||
* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, Integer.MAX_VALUE if unknown
|
* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getCid() {
|
public int getCid() {
|
||||||
return mCid;
|
return mCid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, Integer.MAX_VALUE
|
* @return 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511,
|
||||||
* if unknown
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getPsc() {
|
public int getPsc() {
|
||||||
return mPsc;
|
return mPsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Country Code in string version, null if unknown
|
* @return Mobile Country Code in string version, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMccString() {
|
public String getMccString() {
|
||||||
return mMccStr;
|
return mMccStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mobile Network Code in string version, null if unknown
|
* @return Mobile Network Code in string version, null if unavailable.
|
||||||
*/
|
*/
|
||||||
public String getMncString() {
|
public String getMncString() {
|
||||||
return mMncStr;
|
return mMncStr;
|
||||||
@@ -180,7 +183,8 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 16-bit UMTS Absolute RF Channel Number, Integer.MAX_VALUE if unknown
|
* @return 16-bit UMTS Absolute RF Channel Number,
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getUarfcn() {
|
public int getUarfcn() {
|
||||||
return mUarfcn;
|
return mUarfcn;
|
||||||
@@ -196,9 +200,9 @@ public final class CellIdentityWcdma extends CellIdentity {
|
|||||||
@Override
|
@Override
|
||||||
public GsmCellLocation asCellLocation() {
|
public GsmCellLocation asCellLocation() {
|
||||||
GsmCellLocation cl = new GsmCellLocation();
|
GsmCellLocation cl = new GsmCellLocation();
|
||||||
int lac = mLac != Integer.MAX_VALUE ? mLac : -1;
|
int lac = mLac != CellInfo.UNAVAILABLE ? mLac : -1;
|
||||||
int cid = mCid != Integer.MAX_VALUE ? mCid : -1;
|
int cid = mCid != CellInfo.UNAVAILABLE ? mCid : -1;
|
||||||
int psc = mPsc != Integer.MAX_VALUE ? mPsc : -1;
|
int psc = mPsc != CellInfo.UNAVAILABLE ? mPsc : -1;
|
||||||
cl.setLacAndCid(lac, cid);
|
cl.setLacAndCid(lac, cid);
|
||||||
cl.setPsc(psc);
|
cl.setPsc(psc);
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
*/
|
*/
|
||||||
public abstract class CellInfo implements Parcelable {
|
public abstract class CellInfo implements Parcelable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This value indicates that the integer field is unreported.
|
||||||
|
*/
|
||||||
|
public static final int UNAVAILABLE = Integer.MAX_VALUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cell identity type
|
* Cell identity type
|
||||||
* @hide
|
* @hide
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
* <p>Note that this HAL is inconsistent with UMTS-based radio techs as the value indicating
|
* <p>Note that this HAL is inconsistent with UMTS-based radio techs as the value indicating
|
||||||
* that a field is unreported is negative, rather than a large(r) positive number.
|
* that a field is unreported is negative, rather than a large(r) positive number.
|
||||||
* <p>Also note that to keep the public-facing methods of this class consistent with others,
|
* <p>Also note that to keep the public-facing methods of this class consistent with others,
|
||||||
* unreported values are coerced to Integer.MAX_VALUE rather than left as -1, which is
|
* unreported values are coerced to {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE}
|
||||||
* a departure from SignalStrength, which is stuck with the values it currently reports.
|
* rather than left as -1, which is a departure from SignalStrength, which is stuck with the
|
||||||
|
* values it currently reports.
|
||||||
*
|
*
|
||||||
* @param cdmaDbm negative of the CDMA signal strength value or -1 if invalid.
|
* @param cdmaDbm negative of the CDMA signal strength value or -1 if invalid.
|
||||||
* @param cdmaEcio negative of the CDMA pilot/noise ratio or -1 if invalid.
|
* @param cdmaEcio negative of the CDMA pilot/noise ratio or -1 if invalid.
|
||||||
@@ -65,12 +66,12 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
int evdoSnr) {
|
int evdoSnr) {
|
||||||
// The values here were lifted from SignalStrength.validateInput()
|
// The values here were lifted from SignalStrength.validateInput()
|
||||||
// FIXME: Combine all checking and setting logic between this and SignalStrength.
|
// FIXME: Combine all checking and setting logic between this and SignalStrength.
|
||||||
mCdmaDbm = ((cdmaDbm > 0) && (cdmaDbm < 120)) ? -cdmaDbm : Integer.MAX_VALUE;
|
mCdmaDbm = ((cdmaDbm > 0) && (cdmaDbm < 120)) ? -cdmaDbm : CellInfo.UNAVAILABLE;
|
||||||
mCdmaEcio = ((cdmaEcio > 0) && (cdmaEcio < 160)) ? -cdmaEcio : Integer.MAX_VALUE;
|
mCdmaEcio = ((cdmaEcio > 0) && (cdmaEcio < 160)) ? -cdmaEcio : CellInfo.UNAVAILABLE;
|
||||||
|
|
||||||
mEvdoDbm = ((evdoDbm > 0) && (evdoDbm < 120)) ? -evdoDbm : Integer.MAX_VALUE;
|
mEvdoDbm = ((evdoDbm > 0) && (evdoDbm < 120)) ? -evdoDbm : CellInfo.UNAVAILABLE;
|
||||||
mEvdoEcio = ((evdoEcio > 0) && (evdoEcio < 160)) ? -evdoEcio : Integer.MAX_VALUE;
|
mEvdoEcio = ((evdoEcio > 0) && (evdoEcio < 160)) ? -evdoEcio : CellInfo.UNAVAILABLE;
|
||||||
mEvdoSnr = ((evdoSnr > 0) && (evdoSnr <= 8)) ? evdoSnr : Integer.MAX_VALUE;
|
mEvdoSnr = ((evdoSnr > 0) && (evdoSnr <= 8)) ? evdoSnr : CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@@ -96,11 +97,11 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultValues() {
|
public void setDefaultValues() {
|
||||||
mCdmaDbm = Integer.MAX_VALUE;
|
mCdmaDbm = CellInfo.UNAVAILABLE;
|
||||||
mCdmaEcio = Integer.MAX_VALUE;
|
mCdmaEcio = CellInfo.UNAVAILABLE;
|
||||||
mEvdoDbm = Integer.MAX_VALUE;
|
mEvdoDbm = CellInfo.UNAVAILABLE;
|
||||||
mEvdoEcio = Integer.MAX_VALUE;
|
mEvdoEcio = CellInfo.UNAVAILABLE;
|
||||||
mEvdoSnr = Integer.MAX_VALUE;
|
mEvdoSnr = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,7 +140,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
int cdmaAsuLevel;
|
int cdmaAsuLevel;
|
||||||
int ecioAsuLevel;
|
int ecioAsuLevel;
|
||||||
|
|
||||||
if (cdmaDbm == Integer.MAX_VALUE) cdmaAsuLevel = 99;
|
if (cdmaDbm == CellInfo.UNAVAILABLE) cdmaAsuLevel = 99;
|
||||||
else if (cdmaDbm >= -75) cdmaAsuLevel = 16;
|
else if (cdmaDbm >= -75) cdmaAsuLevel = 16;
|
||||||
else if (cdmaDbm >= -82) cdmaAsuLevel = 8;
|
else if (cdmaDbm >= -82) cdmaAsuLevel = 8;
|
||||||
else if (cdmaDbm >= -90) cdmaAsuLevel = 4;
|
else if (cdmaDbm >= -90) cdmaAsuLevel = 4;
|
||||||
@@ -148,7 +149,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
else cdmaAsuLevel = 99;
|
else cdmaAsuLevel = 99;
|
||||||
|
|
||||||
// Ec/Io are in dB*10
|
// Ec/Io are in dB*10
|
||||||
if (cdmaEcio == Integer.MAX_VALUE) ecioAsuLevel = 99;
|
if (cdmaEcio == CellInfo.UNAVAILABLE) ecioAsuLevel = 99;
|
||||||
else if (cdmaEcio >= -90) ecioAsuLevel = 16;
|
else if (cdmaEcio >= -90) ecioAsuLevel = 16;
|
||||||
else if (cdmaEcio >= -100) ecioAsuLevel = 8;
|
else if (cdmaEcio >= -100) ecioAsuLevel = 8;
|
||||||
else if (cdmaEcio >= -115) ecioAsuLevel = 4;
|
else if (cdmaEcio >= -115) ecioAsuLevel = 4;
|
||||||
@@ -170,7 +171,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
int levelDbm;
|
int levelDbm;
|
||||||
int levelEcio;
|
int levelEcio;
|
||||||
|
|
||||||
if (cdmaDbm == Integer.MAX_VALUE) levelDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
if (cdmaDbm == CellInfo.UNAVAILABLE) levelDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
else if (cdmaDbm >= -75) levelDbm = SIGNAL_STRENGTH_GREAT;
|
else if (cdmaDbm >= -75) levelDbm = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (cdmaDbm >= -85) levelDbm = SIGNAL_STRENGTH_GOOD;
|
else if (cdmaDbm >= -85) levelDbm = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (cdmaDbm >= -95) levelDbm = SIGNAL_STRENGTH_MODERATE;
|
else if (cdmaDbm >= -95) levelDbm = SIGNAL_STRENGTH_MODERATE;
|
||||||
@@ -178,7 +179,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
else levelDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
else levelDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
|
|
||||||
// Ec/Io are in dB*10
|
// Ec/Io are in dB*10
|
||||||
if (cdmaEcio == Integer.MAX_VALUE) levelEcio = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
if (cdmaEcio == CellInfo.UNAVAILABLE) levelEcio = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
else if (cdmaEcio >= -90) levelEcio = SIGNAL_STRENGTH_GREAT;
|
else if (cdmaEcio >= -90) levelEcio = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (cdmaEcio >= -110) levelEcio = SIGNAL_STRENGTH_GOOD;
|
else if (cdmaEcio >= -110) levelEcio = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (cdmaEcio >= -130) levelEcio = SIGNAL_STRENGTH_MODERATE;
|
else if (cdmaEcio >= -130) levelEcio = SIGNAL_STRENGTH_MODERATE;
|
||||||
@@ -199,14 +200,14 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
|
|||||||
int levelEvdoDbm;
|
int levelEvdoDbm;
|
||||||
int levelEvdoSnr;
|
int levelEvdoSnr;
|
||||||
|
|
||||||
if (evdoDbm == Integer.MAX_VALUE) levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
if (evdoDbm == CellInfo.UNAVAILABLE) levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
else if (evdoDbm >= -65) levelEvdoDbm = SIGNAL_STRENGTH_GREAT;
|
else if (evdoDbm >= -65) levelEvdoDbm = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (evdoDbm >= -75) levelEvdoDbm = SIGNAL_STRENGTH_GOOD;
|
else if (evdoDbm >= -75) levelEvdoDbm = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (evdoDbm >= -90) levelEvdoDbm = SIGNAL_STRENGTH_MODERATE;
|
else if (evdoDbm >= -90) levelEvdoDbm = SIGNAL_STRENGTH_MODERATE;
|
||||||
else if (evdoDbm >= -105) levelEvdoDbm = SIGNAL_STRENGTH_POOR;
|
else if (evdoDbm >= -105) levelEvdoDbm = SIGNAL_STRENGTH_POOR;
|
||||||
else levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
else levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
|
|
||||||
if (evdoSnr == Integer.MAX_VALUE) levelEvdoSnr = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
if (evdoSnr == CellInfo.UNAVAILABLE) levelEvdoSnr = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
else if (evdoSnr >= 7) levelEvdoSnr = SIGNAL_STRENGTH_GREAT;
|
else if (evdoSnr >= 7) levelEvdoSnr = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (evdoSnr >= 5) levelEvdoSnr = SIGNAL_STRENGTH_GOOD;
|
else if (evdoSnr >= 5) levelEvdoSnr = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (evdoSnr >= 3) levelEvdoSnr = SIGNAL_STRENGTH_MODERATE;
|
else if (evdoSnr >= 3) levelEvdoSnr = SIGNAL_STRENGTH_MODERATE;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P
|
|||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
|
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private int mTimingAdvance; // range from 0-219 or Integer.MAX_VALUE if unknown
|
private int mTimingAdvance; // range from 0-219 or CellInfo.UNAVAILABLE if unknown
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
@@ -50,7 +50,7 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P
|
|||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellSignalStrengthGsm(int ss, int ber) {
|
public CellSignalStrengthGsm(int ss, int ber) {
|
||||||
this(ss, ber, Integer.MAX_VALUE);
|
this(ss, ber, CellInfo.UNAVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@@ -81,9 +81,9 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultValues() {
|
public void setDefaultValues() {
|
||||||
mSignalStrength = Integer.MAX_VALUE;
|
mSignalStrength = CellInfo.UNAVAILABLE;
|
||||||
mBitErrorRate = Integer.MAX_VALUE;
|
mBitErrorRate = CellInfo.UNAVAILABLE;
|
||||||
mTimingAdvance = Integer.MAX_VALUE;
|
mTimingAdvance = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,8 +112,9 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the GSM timing advance between 0..219 symbols (normally 0..63).
|
* Get the GSM timing advance between 0..219 symbols (normally 0..63).
|
||||||
* Integer.MAX_VALUE is reported when there is no RR connection.
|
* <p>{@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} is reported when there is no RR
|
||||||
* Refer to 3GPP 45.010 Sec 5.8
|
* connection. Refer to 3GPP 45.010 Sec 5.8.
|
||||||
|
*
|
||||||
* @return the current GSM timing advance, if available.
|
* @return the current GSM timing advance, if available.
|
||||||
*/
|
*/
|
||||||
public int getTimingAdvance() {
|
public int getTimingAdvance() {
|
||||||
@@ -128,11 +129,11 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P
|
|||||||
int dBm;
|
int dBm;
|
||||||
|
|
||||||
int level = mSignalStrength;
|
int level = mSignalStrength;
|
||||||
int asu = (level == 99 ? Integer.MAX_VALUE : level);
|
int asu = (level == 99 ? CellInfo.UNAVAILABLE : level);
|
||||||
if (asu != Integer.MAX_VALUE) {
|
if (asu != CellInfo.UNAVAILABLE) {
|
||||||
dBm = -113 + (2 * asu);
|
dBm = -113 + (2 * asu);
|
||||||
} else {
|
} else {
|
||||||
dBm = Integer.MAX_VALUE;
|
dBm = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
if (DBG) log("getDbm=" + dBm);
|
if (DBG) log("getDbm=" + dBm);
|
||||||
return dBm;
|
return dBm;
|
||||||
|
|||||||
@@ -85,12 +85,12 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultValues() {
|
public void setDefaultValues() {
|
||||||
mSignalStrength = Integer.MAX_VALUE;
|
mSignalStrength = CellInfo.UNAVAILABLE;
|
||||||
mRsrp = Integer.MAX_VALUE;
|
mRsrp = CellInfo.UNAVAILABLE;
|
||||||
mRsrq = Integer.MAX_VALUE;
|
mRsrq = CellInfo.UNAVAILABLE;
|
||||||
mRssnr = Integer.MAX_VALUE;
|
mRssnr = CellInfo.UNAVAILABLE;
|
||||||
mCqi = Integer.MAX_VALUE;
|
mCqi = CellInfo.UNAVAILABLE;
|
||||||
mTimingAdvance = Integer.MAX_VALUE;
|
mTimingAdvance = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,26 +104,27 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
int levelRsrp = 0;
|
int levelRsrp = 0;
|
||||||
int levelRssnr = 0;
|
int levelRssnr = 0;
|
||||||
|
|
||||||
if (mRsrp == Integer.MAX_VALUE) levelRsrp = 0;
|
if (mRsrp == CellInfo.UNAVAILABLE) levelRsrp = 0;
|
||||||
else if (mRsrp >= -95) levelRsrp = SIGNAL_STRENGTH_GREAT;
|
else if (mRsrp >= -95) levelRsrp = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (mRsrp >= -105) levelRsrp = SIGNAL_STRENGTH_GOOD;
|
else if (mRsrp >= -105) levelRsrp = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (mRsrp >= -115) levelRsrp = SIGNAL_STRENGTH_MODERATE;
|
else if (mRsrp >= -115) levelRsrp = SIGNAL_STRENGTH_MODERATE;
|
||||||
else levelRsrp = SIGNAL_STRENGTH_POOR;
|
else levelRsrp = SIGNAL_STRENGTH_POOR;
|
||||||
|
|
||||||
// See RIL_LTE_SignalStrength in ril.h
|
// See RIL_LTE_SignalStrength in ril.h
|
||||||
if (mRssnr == Integer.MAX_VALUE) levelRssnr = 0;
|
if (mRssnr == CellInfo.UNAVAILABLE) levelRssnr = 0;
|
||||||
else if (mRssnr >= 45) levelRssnr = SIGNAL_STRENGTH_GREAT;
|
else if (mRssnr >= 45) levelRssnr = SIGNAL_STRENGTH_GREAT;
|
||||||
else if (mRssnr >= 10) levelRssnr = SIGNAL_STRENGTH_GOOD;
|
else if (mRssnr >= 10) levelRssnr = SIGNAL_STRENGTH_GOOD;
|
||||||
else if (mRssnr >= -30) levelRssnr = SIGNAL_STRENGTH_MODERATE;
|
else if (mRssnr >= -30) levelRssnr = SIGNAL_STRENGTH_MODERATE;
|
||||||
else levelRssnr = SIGNAL_STRENGTH_POOR;
|
else levelRssnr = SIGNAL_STRENGTH_POOR;
|
||||||
|
|
||||||
int level;
|
int level;
|
||||||
if (mRsrp == Integer.MAX_VALUE)
|
if (mRsrp == CellInfo.UNAVAILABLE) {
|
||||||
level = levelRssnr;
|
level = levelRssnr;
|
||||||
else if (mRssnr == Integer.MAX_VALUE)
|
} else if (mRssnr == CellInfo.UNAVAILABLE) {
|
||||||
level = levelRsrp;
|
level = levelRsrp;
|
||||||
else
|
} else {
|
||||||
level = (levelRssnr < levelRsrp) ? levelRssnr : levelRsrp;
|
level = (levelRssnr < levelRsrp) ? levelRssnr : levelRsrp;
|
||||||
|
}
|
||||||
|
|
||||||
if (DBG) log("Lte rsrp level: " + levelRsrp
|
if (DBG) log("Lte rsrp level: " + levelRsrp
|
||||||
+ " snr level: " + levelRssnr + " level: " + level);
|
+ " snr level: " + levelRssnr + " level: " + level);
|
||||||
@@ -133,7 +134,8 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
/**
|
/**
|
||||||
* Get reference signal received quality
|
* Get reference signal received quality
|
||||||
*
|
*
|
||||||
* @return the RSRQ if available or Integer.MAX_VALUE if unavailable.
|
* @return the RSRQ if available or
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getRsrq() {
|
public int getRsrq() {
|
||||||
return mRsrq;
|
return mRsrq;
|
||||||
@@ -142,7 +144,8 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
/**
|
/**
|
||||||
* Get reference signal signal-to-noise ratio
|
* Get reference signal signal-to-noise ratio
|
||||||
*
|
*
|
||||||
* @return the RSSNR if available or Integer.MAX_VALUE if unavailable.
|
* @return the RSSNR if available or
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getRssnr() {
|
public int getRssnr() {
|
||||||
return mRssnr;
|
return mRssnr;
|
||||||
@@ -160,7 +163,8 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
/**
|
/**
|
||||||
* Get channel quality indicator
|
* Get channel quality indicator
|
||||||
*
|
*
|
||||||
* @return the CQI if available or Integer.MAX_VALUE if unavailable.
|
* @return the CQI if available or
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getCqi() {
|
public int getCqi() {
|
||||||
return mCqi;
|
return mCqi;
|
||||||
@@ -184,7 +188,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
public int getAsuLevel() {
|
public int getAsuLevel() {
|
||||||
int lteAsuLevel = 99;
|
int lteAsuLevel = 99;
|
||||||
int lteDbm = getDbm();
|
int lteDbm = getDbm();
|
||||||
if (lteDbm == Integer.MAX_VALUE) lteAsuLevel = 99;
|
if (lteDbm == CellInfo.UNAVAILABLE) lteAsuLevel = 99;
|
||||||
else if (lteDbm <= -140) lteAsuLevel = 0;
|
else if (lteDbm <= -140) lteAsuLevel = 0;
|
||||||
else if (lteDbm >= -43) lteAsuLevel = 97;
|
else if (lteDbm >= -43) lteAsuLevel = 97;
|
||||||
else lteAsuLevel = lteDbm + 140;
|
else lteAsuLevel = lteDbm + 140;
|
||||||
@@ -194,10 +198,11 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the timing advance value for LTE, as a value in range of 0..1282.
|
* Get the timing advance value for LTE, as a value in range of 0..1282.
|
||||||
* Integer.MAX_VALUE is reported when there is no active RRC
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} is reported when there is no
|
||||||
* connection. Refer to 3GPP 36.213 Sec 4.2.3
|
* active RRC connection. Refer to 3GPP 36.213 Sec 4.2.3
|
||||||
*
|
*
|
||||||
* @return the LTE timing advance if available or Integer.MAX_VALUE if unavailable.
|
* @return the LTE timing advance if available or
|
||||||
|
* {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} if unavailable.
|
||||||
*/
|
*/
|
||||||
public int getTimingAdvance() {
|
public int getTimingAdvance() {
|
||||||
return mTimingAdvance;
|
return mTimingAdvance;
|
||||||
@@ -252,8 +257,8 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
// Need to multiply rsrp and rsrq by -1
|
// Need to multiply rsrp and rsrq by -1
|
||||||
// to ensure consistency when reading values written here
|
// to ensure consistency when reading values written here
|
||||||
// unless the values are invalid
|
// unless the values are invalid
|
||||||
dest.writeInt(mRsrp * (mRsrp != Integer.MAX_VALUE ? -1 : 1));
|
dest.writeInt(mRsrp * (mRsrp != CellInfo.UNAVAILABLE ? -1 : 1));
|
||||||
dest.writeInt(mRsrq * (mRsrq != Integer.MAX_VALUE ? -1 : 1));
|
dest.writeInt(mRsrq * (mRsrq != CellInfo.UNAVAILABLE ? -1 : 1));
|
||||||
dest.writeInt(mRssnr);
|
dest.writeInt(mRssnr);
|
||||||
dest.writeInt(mCqi);
|
dest.writeInt(mCqi);
|
||||||
dest.writeInt(mTimingAdvance);
|
dest.writeInt(mTimingAdvance);
|
||||||
@@ -268,9 +273,9 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
|
|||||||
// rsrp and rsrq are written into the parcel as positive values.
|
// rsrp and rsrq are written into the parcel as positive values.
|
||||||
// Need to convert into negative values unless the values are invalid
|
// Need to convert into negative values unless the values are invalid
|
||||||
mRsrp = in.readInt();
|
mRsrp = in.readInt();
|
||||||
if (mRsrp != Integer.MAX_VALUE) mRsrp *= -1;
|
if (mRsrp != CellInfo.UNAVAILABLE) mRsrp *= -1;
|
||||||
mRsrq = in.readInt();
|
mRsrq = in.readInt();
|
||||||
if (mRsrq != Integer.MAX_VALUE) mRsrq *= -1;
|
if (mRsrq != CellInfo.UNAVAILABLE) mRsrq *= -1;
|
||||||
mRssnr = in.readInt();
|
mRssnr = in.readInt();
|
||||||
mCqi = in.readInt();
|
mCqi = in.readInt();
|
||||||
mTimingAdvance = in.readInt();
|
mTimingAdvance = in.readInt();
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
|
|||||||
private static final int TDSCDMA_SIGNAL_STRENGTH_MODERATE = 5;
|
private static final int TDSCDMA_SIGNAL_STRENGTH_MODERATE = 5;
|
||||||
|
|
||||||
private int mSignalStrength; // in ASU; Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
private int mSignalStrength; // in ASU; Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
||||||
// or Integer.MAX_VALUE if unknown
|
// or CellInfo.UNAVAILABLE if unknown
|
||||||
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 or
|
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 or
|
||||||
// Integer.MAX_VALUE if unknown
|
// CellInfo.UNAVAILABLE if unknown
|
||||||
private int mRscp; // Pilot power (0-96, 255) as defined in TS 27.007 8.69 or Integer.MAX_VALUE
|
private int mRscp; // Pilot power (0-96, 255) as defined in TS 27.007 8.69 or
|
||||||
// if unknown
|
// CellInfo.UNAVAILABLE if unknown
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellSignalStrengthTdscdma() {
|
public CellSignalStrengthTdscdma() {
|
||||||
@@ -75,9 +75,9 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultValues() {
|
public void setDefaultValues() {
|
||||||
mSignalStrength = Integer.MAX_VALUE;
|
mSignalStrength = CellInfo.UNAVAILABLE;
|
||||||
mBitErrorRate = Integer.MAX_VALUE;
|
mBitErrorRate = CellInfo.UNAVAILABLE;
|
||||||
mRscp = Integer.MAX_VALUE;
|
mRscp = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,11 +118,11 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
|
|||||||
int dBm;
|
int dBm;
|
||||||
|
|
||||||
int level = mSignalStrength;
|
int level = mSignalStrength;
|
||||||
int asu = (level == 99 ? Integer.MAX_VALUE : level);
|
int asu = (level == 99 ? CellInfo.UNAVAILABLE : level);
|
||||||
if (asu != Integer.MAX_VALUE) {
|
if (asu != CellInfo.UNAVAILABLE) {
|
||||||
dBm = -113 + (2 * asu);
|
dBm = -113 + (2 * asu);
|
||||||
} else {
|
} else {
|
||||||
dBm = Integer.MAX_VALUE;
|
dBm = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
if (DBG) log("getDbm=" + dBm);
|
if (DBG) log("getDbm=" + dBm);
|
||||||
return dBm;
|
return dBm;
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ public final class CellSignalStrengthWcdma extends CellSignalStrength implements
|
|||||||
|
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private int mSignalStrength; // in ASU; Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
private int mSignalStrength; // in ASU; Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
||||||
// or Integer.MAX_VALUE if unknown
|
// or CellInfo.UNAVAILABLE if unknown
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 or
|
private int mBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 or
|
||||||
// Integer.MAX_VALUE if unknown
|
// CellInfo.UNAVAILABLE if unknown
|
||||||
private int mRscp; // bit error rate (0-96, 255) as defined in TS 27.007 8.69 or
|
private int mRscp; // bit error rate (0-96, 255) as defined in TS 27.007 8.69 or
|
||||||
// Integer.MAX_VALUE if unknown
|
// CellInfo.UNAVAILABLE if unknown
|
||||||
private int mEcNo; // signal to noise radio (0-49, 255) as defined in TS 27.007 8.69 or
|
private int mEcNo; // signal to noise radio (0-49, 255) as defined in TS 27.007 8.69 or
|
||||||
// Integer.MAX_VALUE if unknown
|
// CellInfo.UNAVAILABLE if unknown
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellSignalStrengthWcdma() {
|
public CellSignalStrengthWcdma() {
|
||||||
@@ -81,10 +81,10 @@ public final class CellSignalStrengthWcdma extends CellSignalStrength implements
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultValues() {
|
public void setDefaultValues() {
|
||||||
mSignalStrength = Integer.MAX_VALUE;
|
mSignalStrength = CellInfo.UNAVAILABLE;
|
||||||
mBitErrorRate = Integer.MAX_VALUE;
|
mBitErrorRate = CellInfo.UNAVAILABLE;
|
||||||
mRscp = Integer.MAX_VALUE;
|
mRscp = CellInfo.UNAVAILABLE;
|
||||||
mEcNo = Integer.MAX_VALUE;
|
mEcNo = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,11 +119,11 @@ public final class CellSignalStrengthWcdma extends CellSignalStrength implements
|
|||||||
int dBm;
|
int dBm;
|
||||||
|
|
||||||
int level = mSignalStrength;
|
int level = mSignalStrength;
|
||||||
int asu = (level == 99 ? Integer.MAX_VALUE : level);
|
int asu = (level == 99 ? CellInfo.UNAVAILABLE : level);
|
||||||
if (asu != Integer.MAX_VALUE) {
|
if (asu != CellInfo.UNAVAILABLE) {
|
||||||
dBm = -113 + (2 * asu);
|
dBm = -113 + (2 * asu);
|
||||||
} else {
|
} else {
|
||||||
dBm = Integer.MAX_VALUE;
|
dBm = CellInfo.UNAVAILABLE;
|
||||||
}
|
}
|
||||||
if (DBG) log("getDbm=" + dBm);
|
if (DBG) log("getDbm=" + dBm);
|
||||||
return dBm;
|
return dBm;
|
||||||
|
|||||||
Reference in New Issue
Block a user