Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1ec4ead authored by Nathan Harold's avatar Nathan Harold Committed by android-build-merger
Browse files

Merge "Add API to Retrieve Detailed SignalStrength Info" am: b6d32aa5 am: 1ee0a3de

am: ce349cfe

Change-Id: I18d9630985320432870518b402ba7ac57e7b1337
parents 20330218 ce349cfe
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -44336,6 +44336,7 @@ package android.telephony {
    method public int describeContents();
    method public int describeContents();
    method public int getCdmaDbm();
    method public int getCdmaDbm();
    method public int getCdmaEcio();
    method public int getCdmaEcio();
    method public java.util.List<android.telephony.CellSignalStrength> getCellSignalStrengths();
    method public int getEvdoDbm();
    method public int getEvdoDbm();
    method public int getEvdoEcio();
    method public int getEvdoEcio();
    method public int getEvdoSnr();
    method public int getEvdoSnr();
+31 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,8 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.PersistableBundle;


import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Objects;


/**
/**
@@ -178,6 +180,35 @@ public class SignalStrength implements Parcelable {
        return mLte;
        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 */
    /** @hide */
    public void updateLevel(PersistableBundle cc, ServiceState ss) {
    public void updateLevel(PersistableBundle cc, ServiceState ss) {
        mLteRsrpBoost = ss.getLteEarfcnRsrpBoost();
        mLteRsrpBoost = ss.getLteEarfcnRsrpBoost();