Expose CellInfoTdscdma

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
Change-Id: Ia75ea9af52796729e26b85ca04fd97b6c9b80f8e
(cherry picked from commit b2bfb29595)
This commit is contained in:
Nathan Harold
2019-03-19 13:20:17 -07:00
parent 6b49665d79
commit 2175839ead
4 changed files with 53 additions and 17 deletions

View File

@@ -44511,6 +44511,13 @@ package android.telephony {
field @NonNull 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();
@@ -44594,6 +44601,16 @@ package android.telephony {
field @NonNull 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();

View File

@@ -16,6 +16,7 @@
package android.telephony;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
@@ -203,6 +204,12 @@ public final class CellIdentityTdscdma extends CellIdentity {
.append("}").toString();
}
/** Implement the Parcelable interface */
@Override
public int describeContents() {
return 0;
}
/** Implement the Parcelable interface */
@Override
public void writeToParcel(Parcel dest, int flags) {
@@ -226,16 +233,17 @@ public final class CellIdentityTdscdma extends CellIdentity {
/** Implement the Parcelable interface */
@SuppressWarnings("hiding")
public static final @android.annotation.NonNull Creator<CellIdentityTdscdma> CREATOR =
@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];
}
};

View File

@@ -16,6 +16,7 @@
package android.telephony;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
@@ -24,7 +25,9 @@ import java.util.Objects;
/**
* 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 {
@@ -72,18 +75,21 @@ 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;
@@ -149,15 +155,16 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable {
}
/** Implement the Parcelable interface */
public static final @android.annotation.NonNull Creator<CellInfoTdscdma> CREATOR = new Creator<CellInfoTdscdma>() {
@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];
}
};

View File

@@ -16,6 +16,7 @@
package android.telephony;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;
@@ -25,7 +26,8 @@ import java.util.Objects;
/**
* 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 {
@@ -59,7 +61,9 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
* @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);
@@ -148,8 +152,7 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
}
/**
* Get the RSCP as dBm
* @hide
* Get the RSCP as dBm value -120..-24dBm or {@link CellInfo#UNAVAILABLE UNAVAILABLE}.
*/
public int getRscp() {
return mRscp;
@@ -160,7 +163,7 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
*
* 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() {
@@ -237,15 +240,16 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
/** Implement the Parcelable interface */
@SuppressWarnings("hiding")
public static final @android.annotation.NonNull Parcelable.Creator<CellSignalStrengthTdscdma> CREATOR =
@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];
}
};