Merge "Add API to Retrieve Detailed SignalStrength Info" am: b6d32aa5e8

am: 1ee0a3de13

Change-Id: I9abe7802a5e04714275efc901bcff295625c5b1f
This commit is contained in:
Nathan Harold
2019-01-14 11:37:32 -08:00
committed by android-build-merger
2 changed files with 32 additions and 0 deletions

View File

@@ -42730,6 +42730,7 @@ package android.telephony {
method public int describeContents();
method public int getCdmaDbm();
method public int getCdmaEcio();
method public java.util.List<android.telephony.CellSignalStrength> getCellSignalStrengths();
method public int getEvdoDbm();
method public int getEvdoEcio();
method public int getEvdoSnr();

View File

@@ -24,6 +24,8 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
@@ -178,6 +180,35 @@ public class SignalStrength implements Parcelable {
return mLte;
}
/**
* Returns a List of CellSignalStrength Components of this SignalStrength Report.
*
* Use this API to access underlying
* {@link android.telephony#CellSignalStrength CellSignalStrength} objects that provide more
* granular information about the SignalStrength report. Only valid (non-empty)
* CellSignalStrengths will be returned. The order of any returned elements is not guaranteed,
* and the list may contain more than one instance of a CellSignalStrength type.
*
* @return a List of CellSignalStrength or an empty List if there are no valid measurements.
*
* @see android.telephony#CellSignalStrength
* @see android.telephony#CellSignalStrengthNr
* @see android.telephony#CellSignalStrengthLte
* @see android.telephony#CellSignalStrengthTdscdma
* @see android.telephony#CellSignalStrengthWcdma
* @see android.telephony#CellSignalStrengthCdma
* @see android.telephony#CellSignalStrengthGsm
*/
public @NonNull List<CellSignalStrength> getCellSignalStrengths() {
List<CellSignalStrength> cssList = new ArrayList<>(2); // Usually have 2 or fewer elems
if (mLte.isValid()) cssList.add(mLte);
if (mCdma.isValid()) cssList.add(mCdma);
if (mTdscdma.isValid()) cssList.add(mTdscdma);
if (mWcdma.isValid()) cssList.add(mWcdma);
if (mGsm.isValid()) cssList.add(mGsm);
return cssList;
}
/** @hide */
public void updateLevel(PersistableBundle cc, ServiceState ss) {
mLteRsrpBoost = ss.getLteEarfcnRsrpBoost();