Merge "Expose CellInfoTdscdma"

This commit is contained in:
Nathan Harold
2019-03-21 23:19:43 +00:00
committed by Gerrit Code Review
4 changed files with 51 additions and 15 deletions

View File

@@ -42382,7 +42382,7 @@ package android.telephony {
method @Nullable public String getMobileNetworkOperator(); method @Nullable public String getMobileNetworkOperator();
method public int getUarfcn(); method public int getUarfcn();
method public void writeToParcel(android.os.Parcel, int); 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 { public final class CellIdentityWcdma extends android.telephony.CellIdentity {
@@ -42441,6 +42441,13 @@ package android.telephony {
field public static final android.os.Parcelable.Creator<android.telephony.CellInfoNr> CREATOR; 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 { public final class CellInfoWcdma extends android.telephony.CellInfo implements android.os.Parcelable {
method public android.telephony.CellIdentityWcdma getCellIdentity(); method public android.telephony.CellIdentityWcdma getCellIdentity();
method public android.telephony.CellSignalStrengthWcdma getCellSignalStrength(); method public android.telephony.CellSignalStrengthWcdma getCellSignalStrength();
@@ -42524,6 +42531,16 @@ package android.telephony {
field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthNr> CREATOR; 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 { public final class CellSignalStrengthWcdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
method public int describeContents(); method public int describeContents();
method public int getAsuLevel(); method public int getAsuLevel();

View File

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

View File

@@ -16,6 +16,7 @@
package android.telephony; package android.telephony;
import android.annotation.NonNull;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; 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. * 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 { 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); mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma);
} }
@Override public CellIdentityTdscdma getCellIdentity() { @Override
public @NonNull CellIdentityTdscdma getCellIdentity() {
return mCellIdentityTdscdma; return mCellIdentityTdscdma;
} }
/** @hide */ /** @hide */
public void setCellIdentity(CellIdentityTdscdma cid) { public void setCellIdentity(CellIdentityTdscdma cid) {
mCellIdentityTdscdma = cid; mCellIdentityTdscdma = cid;
} }
@Override @Override
public CellSignalStrengthTdscdma getCellSignalStrength() { public @NonNull CellSignalStrengthTdscdma getCellSignalStrength() {
return mCellSignalStrengthTdscdma; return mCellSignalStrengthTdscdma;
} }
/** @hide */ /** @hide */
public void setCellSignalStrength(CellSignalStrengthTdscdma css) { public void setCellSignalStrength(CellSignalStrengthTdscdma css) {
mCellSignalStrengthTdscdma = css; mCellSignalStrengthTdscdma = css;
@@ -149,15 +155,16 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable {
} }
/** Implement the Parcelable interface */ /** Implement the Parcelable interface */
@NonNull
public static final Creator<CellInfoTdscdma> CREATOR = new Creator<CellInfoTdscdma>() { public static final Creator<CellInfoTdscdma> CREATOR = new Creator<CellInfoTdscdma>() {
@Override @Override
public CellInfoTdscdma createFromParcel(Parcel in) { public @NonNull CellInfoTdscdma createFromParcel(Parcel in) {
in.readInt(); // Skip past token, we know what it is in.readInt(); // Skip past token, we know what it is
return createFromParcelBody(in); return createFromParcelBody(in);
} }
@Override @Override
public CellInfoTdscdma[] newArray(int size) { public @NonNull CellInfoTdscdma[] newArray(int size) {
return new CellInfoTdscdma[size]; return new CellInfoTdscdma[size];
} }
}; };

View File

@@ -16,6 +16,7 @@
package android.telephony; package android.telephony;
import android.annotation.NonNull;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.os.PersistableBundle; import android.os.PersistableBundle;
@@ -25,7 +26,8 @@ import java.util.Objects;
/** /**
* Tdscdma signal strength related information. * 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 { 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 rssi in dBm [-113, -51] or UNAVAILABLE
* @param ber [0-7], 99 or UNAVAILABLE * @param ber [0-7], 99 or UNAVAILABLE
* @param rscp in dBm [-120, -24] or UNAVAILABLE * @param rscp in dBm [-120, -24] or UNAVAILABLE
* @hide */ *
* @hide
*/
public CellSignalStrengthTdscdma(int rssi, int ber, int rscp) { public CellSignalStrengthTdscdma(int rssi, int ber, int rscp) {
mRssi = inRangeOrUnavailable(rssi, -113, -51); mRssi = inRangeOrUnavailable(rssi, -113, -51);
mBitErrorRate = inRangeOrUnavailable(ber, 0, 7, 99); mBitErrorRate = inRangeOrUnavailable(ber, 0, 7, 99);
@@ -148,8 +152,7 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
} }
/** /**
* Get the RSCP as dBm * Get the RSCP as dBm value -120..-24dBm or {@link CellInfo#UNAVAILABLE UNAVAILABLE}.
* @hide
*/ */
public int getRscp() { public int getRscp() {
return mRscp; 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 * 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 @Override
public int getAsuLevel() { public int getAsuLevel() {
@@ -237,15 +240,16 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen
/** Implement the Parcelable interface */ /** Implement the Parcelable interface */
@SuppressWarnings("hiding") @SuppressWarnings("hiding")
@NonNull
public static final Parcelable.Creator<CellSignalStrengthTdscdma> CREATOR = public static final Parcelable.Creator<CellSignalStrengthTdscdma> CREATOR =
new Parcelable.Creator<CellSignalStrengthTdscdma>() { new Parcelable.Creator<CellSignalStrengthTdscdma>() {
@Override @Override
public CellSignalStrengthTdscdma createFromParcel(Parcel in) { public @NonNull CellSignalStrengthTdscdma createFromParcel(Parcel in) {
return new CellSignalStrengthTdscdma(in); return new CellSignalStrengthTdscdma(in);
} }
@Override @Override
public CellSignalStrengthTdscdma[] newArray(int size) { public @NonNull CellSignalStrengthTdscdma[] newArray(int size) {
return new CellSignalStrengthTdscdma[size]; return new CellSignalStrengthTdscdma[size];
} }
}; };