Expose CellInfoTdscdma and CellSignalStrengthTdscdma
which are both returned by existing public APIs.
This corrects an oversight whereby the values returned
by the public API could not be used by callers.
Existing CTS tests already validate these structures as
though they were public (which was the intention).
Note, this was also requested as feedback in the public
beta.
Bug:
128880490
Test: cts - atest CellInfoTest; atest SignalStrengthTest
Merged-In: Ia75ea9af52796729e26b85ca04fd97b6c9b80f8e
Change-Id: Ia75ea9af52796729e26b85ca04fd97b6c9b80f8e
method @Nullable public String getMobileNetworkOperator();
method public int getUarfcn();
method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityTdscdma> CREATOR;
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellIdentityTdscdma> CREATOR;
}
public final class CellIdentityWcdma extends android.telephony.CellIdentity {
field public static final android.os.Parcelable.Creator<android.telephony.CellInfoNr> CREATOR;
}
+ public final class CellInfoTdscdma extends android.telephony.CellInfo implements android.os.Parcelable {
+ method @NonNull public android.telephony.CellIdentityTdscdma getCellIdentity();
+ method @NonNull public android.telephony.CellSignalStrengthTdscdma getCellSignalStrength();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellInfoTdscdma> CREATOR;
+ }
+
public final class CellInfoWcdma extends android.telephony.CellInfo implements android.os.Parcelable {
method public android.telephony.CellIdentityWcdma getCellIdentity();
method public android.telephony.CellSignalStrengthWcdma getCellSignalStrength();
field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthNr> CREATOR;
}
+ public final class CellSignalStrengthTdscdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAsuLevel();
+ method public int getDbm();
+ method public int getLevel();
+ method public int getRscp();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthTdscdma> CREATOR;
+ }
+
public final class CellSignalStrengthWcdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
method public int describeContents();
method public int getAsuLevel();
package android.telephony;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
/** Implement the Parcelable interface */
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface */
+ @Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
super.writeToParcel(dest, CellInfo.TYPE_TDSCDMA);
/** Implement the Parcelable interface */
@SuppressWarnings("hiding")
+ @NonNull
public static final Creator<CellIdentityTdscdma> CREATOR =
new Creator<CellIdentityTdscdma>() {
@Override
- public CellIdentityTdscdma createFromParcel(Parcel in) {
+ public @NonNull CellIdentityTdscdma createFromParcel(Parcel in) {
in.readInt(); // skip
return createFromParcelBody(in);
}
@Override
- public CellIdentityTdscdma[] newArray(int size) {
+ public @NonNull CellIdentityTdscdma[] newArray(int size) {
return new CellIdentityTdscdma[size];
}
};
package android.telephony;
+import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
/**
* A {@link CellInfo} representing a TD-SCDMA cell that provides identity and measurement info.
*
- * @hide
+ * @see android.telephony.CellInfo
+ * @see android.telephony.CellSignalStrengthTdscdma
+ * @see android.telephony.CellIdentityTdscdma
*/
public final class CellInfoTdscdma extends CellInfo implements Parcelable {
mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma);
}
- @Override public CellIdentityTdscdma getCellIdentity() {
+ @Override
+ public @NonNull CellIdentityTdscdma getCellIdentity() {
return mCellIdentityTdscdma;
}
+
/** @hide */
public void setCellIdentity(CellIdentityTdscdma cid) {
mCellIdentityTdscdma = cid;
}
@Override
- public CellSignalStrengthTdscdma getCellSignalStrength() {
+ public @NonNull CellSignalStrengthTdscdma getCellSignalStrength() {
return mCellSignalStrengthTdscdma;
}
+
/** @hide */
public void setCellSignalStrength(CellSignalStrengthTdscdma css) {
mCellSignalStrengthTdscdma = css;
}
/** Implement the Parcelable interface */
+ @NonNull
public static final Creator<CellInfoTdscdma> CREATOR = new Creator<CellInfoTdscdma>() {
@Override
- public CellInfoTdscdma createFromParcel(Parcel in) {
+ public @NonNull CellInfoTdscdma createFromParcel(Parcel in) {
in.readInt(); // Skip past token, we know what it is
return createFromParcelBody(in);
}
@Override
- public CellInfoTdscdma[] newArray(int size) {
+ public @NonNull CellInfoTdscdma[] newArray(int size) {
return new CellInfoTdscdma[size];
}
};
package android.telephony;
+import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;
/**
* Tdscdma signal strength related information.
*
- * @hide
+ * This class provides signal strength and signal quality information for the TD-SCDMA air
+ * interface. For more information see 3gpp 25.225.
*/
public final class CellSignalStrengthTdscdma extends CellSignalStrength implements Parcelable {
* @param rssi in dBm [-113, -51] or UNAVAILABLE
* @param ber [0-7], 99 or UNAVAILABLE
* @param rscp in dBm [-120, -24] or UNAVAILABLE
- * @hide */
+ *
+ * @hide
+ */
public CellSignalStrengthTdscdma(int rssi, int ber, int rscp) {
mRssi = inRangeOrUnavailable(rssi, -113, -51);
mBitErrorRate = inRangeOrUnavailable(ber, 0, 7, 99);
}
/**
- * Get the RSCP as dBm
- * @hide
+ * Get the RSCP as dBm value -120..-24dBm or {@link CellInfo#UNAVAILABLE UNAVAILABLE}.
*/
public int getRscp() {
return mRscp;
*
* Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
*
- * @return RSCP in ASU 0..96, 255, or UNAVAILABLE
+ * @return RSCP in ASU 0..96, 255, or {@link CellInfo#UNAVAILABLE UNAVAILABLE}.
*/
@Override
public int getAsuLevel() {
/** Implement the Parcelable interface */
@SuppressWarnings("hiding")
+ @NonNull
public static final Parcelable.Creator<CellSignalStrengthTdscdma> CREATOR =
new Parcelable.Creator<CellSignalStrengthTdscdma>() {
@Override
- public CellSignalStrengthTdscdma createFromParcel(Parcel in) {
+ public @NonNull CellSignalStrengthTdscdma createFromParcel(Parcel in) {
return new CellSignalStrengthTdscdma(in);
}
@Override
- public CellSignalStrengthTdscdma[] newArray(int size) {
+ public @NonNull CellSignalStrengthTdscdma[] newArray(int size) {
return new CellSignalStrengthTdscdma[size];
}
};