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

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

Merge "Rework SignalStrength"

am: 41f3cfb1

Change-Id: Ib63cb12f2d5bb9d25b3e41f48c3c283a934754b2
parents 00557c66 41f3cfb1
Loading
Loading
Loading
Loading
+29 −108
Original line number Original line Diff line number Diff line
@@ -75,6 +75,10 @@ import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.CellIdentityCdma;
import android.telephony.CellIdentityCdma;
import android.telephony.CellInfo;
import android.telephony.CellInfo;
import android.telephony.CellSignalStrengthCdma;
import android.telephony.CellSignalStrengthCdma;
import android.telephony.CellSignalStrengthGsm;
import android.telephony.CellSignalStrengthLte;
import android.telephony.CellSignalStrengthTdscdma;
import android.telephony.CellSignalStrengthWcdma;
import android.telephony.ClientRequestStats;
import android.telephony.ClientRequestStats;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.ModemActivityInfo;
import android.telephony.ModemActivityInfo;
@@ -85,7 +89,6 @@ import android.telephony.RadioAccessFamily;
import android.telephony.RadioAccessSpecifier;
import android.telephony.RadioAccessSpecifier;
import android.telephony.Rlog;
import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SmsManager;
import android.telephony.SmsManager;
import android.telephony.TelephonyHistogram;
import android.telephony.TelephonyHistogram;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
@@ -136,7 +139,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    // Have a separate wakelock instance for Ack
    // Have a separate wakelock instance for Ack
    static final String RILJ_ACK_WAKELOCK_NAME = "RILJ_ACK_WL";
    static final String RILJ_ACK_WAKELOCK_NAME = "RILJ_ACK_WL";
    static final boolean RILJ_LOGD = true;
    static final boolean RILJ_LOGD = true;
    static final boolean RILJ_LOGV = false; // STOPSHIP if true
    static final boolean RILJ_LOGV = true; // STOPSHIP if true
    static final int RIL_HISTOGRAM_BUCKET_COUNT = 5;
    static final int RIL_HISTOGRAM_BUCKET_COUNT = 5;


    /**
    /**
@@ -5402,7 +5405,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    // TODO(b/119224773) refactor the converter of CellInfo.
    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForGsm(
    private static void writeToParcelForGsm(
            Parcel p, int lac, int cid, int arfcn, int bsic, String mcc, String mnc,
            Parcel p, int lac, int cid, int arfcn, int bsic, String mcc, String mnc,
            String al, String as, int ss, int ber, int ta) {
            String al, String as, CellSignalStrengthGsm ss) {
        p.writeInt(CellInfo.TYPE_GSM);
        p.writeInt(CellInfo.TYPE_GSM);
        p.writeString(mcc);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(mnc);
@@ -5412,23 +5415,21 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(cid);
        p.writeInt(cid);
        p.writeInt(arfcn);
        p.writeInt(arfcn);
        p.writeInt(bsic);
        p.writeInt(bsic);
        p.writeInt(ss);
        ss.writeToParcel(p, 0);
        p.writeInt(ber);
        p.writeInt(ta);
    }
    }


    // TODO(b/119224773) refactor the converter of CellInfo.
    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForCdma(
    private static void writeToParcelForCdma(
            Parcel p, int ni, int si, int bsi, int lon, int lat, String al, String as,
            Parcel p, int ni, int si, int bsi, int lon, int lat, String al, String as,
            int dbm, int ecio, int eDbm, int eEcio, int eSnr) {
            CellSignalStrengthCdma ss) {
        new CellIdentityCdma(ni, si, bsi, lon, lat, al, as).writeToParcel(p, 0);
        new CellIdentityCdma(ni, si, bsi, lon, lat, al, as).writeToParcel(p, 0);
        new CellSignalStrengthCdma(dbm, ecio, eDbm, eEcio, eSnr).writeToParcel(p, 0);
        ss.writeToParcel(p, 0);
    }
    }


    // TODO(b/119224773) refactor the converter of CellInfo.
    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForLte(
    private static void writeToParcelForLte(
            Parcel p, int ci, int pci, int tac, int earfcn, int bandwidth, String mcc, String mnc,
            Parcel p, int ci, int pci, int tac, int earfcn, int bandwidth, String mcc, String mnc,
            String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta,
            String al, String as, CellSignalStrengthLte ss,
            boolean isEndcAvailable) {
            boolean isEndcAvailable) {


        // General CellInfo
        // General CellInfo
@@ -5446,12 +5447,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(bandwidth);
        p.writeInt(bandwidth);


        // CellSignalStrength
        // CellSignalStrength
        p.writeInt(ss);
        ss.writeToParcel(p, 0);
        p.writeInt(rsrp);
        p.writeInt(rsrq);
        p.writeInt(rssnr);
        p.writeInt(cqi);
        p.writeInt(ta);


        // CellConfigLte
        // CellConfigLte
        p.writeBoolean(isEndcAvailable);
        p.writeBoolean(isEndcAvailable);
@@ -5460,7 +5456,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    // TODO(b/119224773) refactor the converter of CellInfo.
    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForWcdma(
    private static void writeToParcelForWcdma(
            Parcel p, int lac, int cid, int psc, int uarfcn, String mcc, String mnc,
            Parcel p, int lac, int cid, int psc, int uarfcn, String mcc, String mnc,
            String al, String as, int ss, int ber, int rscp, int ecno) {
            String al, String as, CellSignalStrengthWcdma ss) {
        p.writeInt(CellInfo.TYPE_WCDMA);
        p.writeInt(CellInfo.TYPE_WCDMA);
        p.writeString(mcc);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(mnc);
@@ -5470,16 +5466,13 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(cid);
        p.writeInt(cid);
        p.writeInt(psc);
        p.writeInt(psc);
        p.writeInt(uarfcn);
        p.writeInt(uarfcn);
        p.writeInt(ss);
        ss.writeToParcel(p, 0);
        p.writeInt(ber);
        p.writeInt(rscp);
        p.writeInt(ecno);
    }
    }


    // TODO(b/119224773) refactor the converter of CellInfo.
    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForTdscdma(
    private static void writeToParcelForTdscdma(
            Parcel p, int lac, int cid, int cpid, int uarfcn, String mcc, String mnc,
            Parcel p, int lac, int cid, int cpid, int uarfcn, String mcc, String mnc,
            String al, String as, int ss, int ber, int rscp) {
            String al, String as, CellSignalStrengthTdscdma ss) {
        p.writeInt(CellInfo.TYPE_TDSCDMA);
        p.writeInt(CellInfo.TYPE_TDSCDMA);
        p.writeString(mcc);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(mnc);
@@ -5489,9 +5482,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(cid);
        p.writeInt(cid);
        p.writeInt(cpid);
        p.writeInt(cpid);
        p.writeInt(uarfcn);
        p.writeInt(uarfcn);
        p.writeInt(ss);
        ss.writeToParcel(p, 0);
        p.writeInt(ber);
        p.writeInt(rscp);
    }
    }


    /**
    /**
@@ -5524,9 +5515,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoGsm.cellIdentityGsm.mnc,
                            cellInfoGsm.cellIdentityGsm.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            EMPTY_ALPHA_SHORT,
                            cellInfoGsm.signalStrengthGsm.signalStrength,
                            new CellSignalStrengthGsm(cellInfoGsm.signalStrengthGsm));
                            cellInfoGsm.signalStrengthGsm.bitErrorRate,
                            cellInfoGsm.signalStrengthGsm.timingAdvance);
                    break;
                    break;
                }
                }


@@ -5541,11 +5530,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoCdma.cellIdentityCdma.latitude,
                            cellInfoCdma.cellIdentityCdma.latitude,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            EMPTY_ALPHA_SHORT,
                            cellInfoCdma.signalStrengthCdma.dbm,
                            new CellSignalStrengthCdma(
                            cellInfoCdma.signalStrengthCdma.ecio,
                                    cellInfoCdma.signalStrengthCdma,
                            cellInfoCdma.signalStrengthEvdo.dbm,
                                    cellInfoCdma.signalStrengthEvdo));
                            cellInfoCdma.signalStrengthEvdo.ecio,
                            cellInfoCdma.signalStrengthEvdo.signalNoiseRatio);
                    break;
                    break;
                }
                }


@@ -5562,12 +5549,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoLte.cellIdentityLte.mnc,
                            cellInfoLte.cellIdentityLte.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            EMPTY_ALPHA_SHORT,
                            cellInfoLte.signalStrengthLte.signalStrength,
                            new CellSignalStrengthLte(cellInfoLte.signalStrengthLte),
                            cellInfoLte.signalStrengthLte.rsrp,
                            cellInfoLte.signalStrengthLte.rsrq,
                            cellInfoLte.signalStrengthLte.rssnr,
                            cellInfoLte.signalStrengthLte.cqi,
                            cellInfoLte.signalStrengthLte.timingAdvance,
                            false /* isEndcAvailable */);
                            false /* isEndcAvailable */);
                    break;
                    break;
                }
                }
@@ -5584,10 +5566,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoWcdma.cellIdentityWcdma.mnc,
                            cellInfoWcdma.cellIdentityWcdma.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            EMPTY_ALPHA_SHORT,
                            cellInfoWcdma.signalStrengthWcdma.signalStrength,
                            new CellSignalStrengthWcdma(cellInfoWcdma.signalStrengthWcdma));
                            cellInfoWcdma.signalStrengthWcdma.bitErrorRate,
                            Integer.MAX_VALUE,
                            Integer.MAX_VALUE);
                    break;
                    break;
                }
                }


@@ -5603,9 +5582,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoTdscdma.cellIdentityTdscdma.mnc,
                            cellInfoTdscdma.cellIdentityTdscdma.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            EMPTY_ALPHA_SHORT,
                            Integer.MAX_VALUE,
                            new CellSignalStrengthTdscdma(cellInfoTdscdma.signalStrengthTdscdma));
                            Integer.MAX_VALUE,
                            convertTdscdmaRscpTo1_2(cellInfoTdscdma.signalStrengthTdscdma.rscp));
                    break;
                    break;
                }
                }
                default:
                default:
@@ -5651,9 +5628,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoGsm.cellIdentityGsm.base.mnc,
                            cellInfoGsm.cellIdentityGsm.base.mnc,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaLong,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaLong,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaShort,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaShort,
                            cellInfoGsm.signalStrengthGsm.signalStrength,
                            new CellSignalStrengthGsm(cellInfoGsm.signalStrengthGsm));
                            cellInfoGsm.signalStrengthGsm.bitErrorRate,
                            cellInfoGsm.signalStrengthGsm.timingAdvance);
                    break;
                    break;
                }
                }


@@ -5668,11 +5643,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoCdma.cellIdentityCdma.base.latitude,
                            cellInfoCdma.cellIdentityCdma.base.latitude,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaLong,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaLong,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaShort,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaShort,
                            cellInfoCdma.signalStrengthCdma.dbm,
                            new CellSignalStrengthCdma(
                            cellInfoCdma.signalStrengthCdma.ecio,
                                cellInfoCdma.signalStrengthCdma,
                            cellInfoCdma.signalStrengthEvdo.dbm,
                                cellInfoCdma.signalStrengthEvdo));
                            cellInfoCdma.signalStrengthEvdo.ecio,
                            cellInfoCdma.signalStrengthEvdo.signalNoiseRatio);
                    break;
                    break;
                }
                }


@@ -5689,12 +5662,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoLte.cellIdentityLte.base.mnc,
                            cellInfoLte.cellIdentityLte.base.mnc,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaLong,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaLong,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaShort,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaShort,
                            cellInfoLte.signalStrengthLte.signalStrength,
                            new CellSignalStrengthLte(cellInfoLte.signalStrengthLte),
                            cellInfoLte.signalStrengthLte.rsrp,
                            cellInfoLte.signalStrengthLte.rsrq,
                            cellInfoLte.signalStrengthLte.rssnr,
                            cellInfoLte.signalStrengthLte.cqi,
                            cellInfoLte.signalStrengthLte.timingAdvance,
                            false /* isEndcAvailable */);
                            false /* isEndcAvailable */);
                    break;
                    break;
                }
                }
@@ -5711,10 +5679,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoWcdma.cellIdentityWcdma.base.mnc,
                            cellInfoWcdma.cellIdentityWcdma.base.mnc,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaLong,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaLong,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaShort,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaShort,
                            cellInfoWcdma.signalStrengthWcdma.base.signalStrength,
                            new CellSignalStrengthWcdma(cellInfoWcdma.signalStrengthWcdma));
                            cellInfoWcdma.signalStrengthWcdma.base.bitErrorRate,
                            cellInfoWcdma.signalStrengthWcdma.rscp,
                            cellInfoWcdma.signalStrengthWcdma.ecno);
                    break;
                    break;
                }
                }


@@ -5731,9 +5696,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoTdscdma.cellIdentityTdscdma.base.mnc,
                            cellInfoTdscdma.cellIdentityTdscdma.base.mnc,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaLong,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaLong,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaShort,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaShort,
                            cellInfoTdscdma.signalStrengthTdscdma.signalStrength,
                            new CellSignalStrengthTdscdma(cellInfoTdscdma.signalStrengthTdscdma));
                            cellInfoTdscdma.signalStrengthTdscdma.bitErrorRate,
                            cellInfoTdscdma.signalStrengthTdscdma.rscp);
                    break;
                    break;
                }
                }


@@ -5762,48 +5725,6 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return Integer.MAX_VALUE;
        return Integer.MAX_VALUE;
    }
    }


    /** Convert HAL 1.0 Signal Strength to android SignalStrength */
    @VisibleForTesting
    public static SignalStrength convertHalSignalStrength(
            android.hardware.radio.V1_0.SignalStrength signalStrength) {
        return new SignalStrength(
                signalStrength.gw.signalStrength,
                signalStrength.gw.bitErrorRate,
                signalStrength.cdma.dbm,
                signalStrength.cdma.ecio,
                signalStrength.evdo.dbm,
                signalStrength.evdo.ecio,
                signalStrength.evdo.signalNoiseRatio,
                signalStrength.lte.signalStrength,
                signalStrength.lte.rsrp,
                signalStrength.lte.rsrq,
                signalStrength.lte.rssnr,
                signalStrength.lte.cqi,
                convertTdscdmaRscpTo1_2(signalStrength.tdScdma.rscp));
    }

    /** Convert HAL 1.2 Signal Strength to android SignalStrength */
    @VisibleForTesting
    public static SignalStrength convertHalSignalStrength_1_2(
            android.hardware.radio.V1_2.SignalStrength signalStrength) {
        return new SignalStrength(
                signalStrength.gsm.signalStrength,
                signalStrength.gsm.bitErrorRate,
                signalStrength.cdma.dbm,
                signalStrength.cdma.ecio,
                signalStrength.evdo.dbm,
                signalStrength.evdo.ecio,
                signalStrength.evdo.signalNoiseRatio,
                signalStrength.lte.signalStrength,
                signalStrength.lte.rsrp,
                signalStrength.lte.rsrq,
                signalStrength.lte.rssnr,
                signalStrength.lte.cqi,
                signalStrength.tdScdma.rscp,
                signalStrength.wcdma.base.signalStrength,
                signalStrength.wcdma.rscp);
    }

    /**
    /**
     * @return The {@link IwlanOperationMode IWLAN operation mode}
     * @return The {@link IwlanOperationMode IWLAN operation mode}
     */
     */
+2 −2
Original line number Original line Diff line number Diff line
@@ -229,7 +229,7 @@ public class RadioIndication extends IRadioIndication.Stub {
                                      android.hardware.radio.V1_0.SignalStrength signalStrength) {
                                      android.hardware.radio.V1_0.SignalStrength signalStrength) {
        mRil.processIndication(indicationType);
        mRil.processIndication(indicationType);


        SignalStrength ss = RIL.convertHalSignalStrength(signalStrength);
        SignalStrength ss = new SignalStrength(signalStrength);
        // Note this is set to "verbose" because it happens frequently
        // Note this is set to "verbose" because it happens frequently
        if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
        if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);


@@ -261,7 +261,7 @@ public class RadioIndication extends IRadioIndication.Stub {
                                      android.hardware.radio.V1_2.SignalStrength signalStrength) {
                                      android.hardware.radio.V1_2.SignalStrength signalStrength) {
        mRil.processIndication(indicationType);
        mRil.processIndication(indicationType);


        SignalStrength ss = RIL.convertHalSignalStrength_1_2(signalStrength);
        SignalStrength ss = new SignalStrength(signalStrength);
        // Note this is set to "verbose" because it happens frequently
        // Note this is set to "verbose" because it happens frequently
        if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
        if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);


+2 −2
Original line number Original line Diff line number Diff line
@@ -1720,7 +1720,7 @@ public class RadioResponse extends IRadioResponse.Stub {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(responseInfo);


        if (rr != null) {
        if (rr != null) {
            SignalStrength ret = RIL.convertHalSignalStrength(signalStrength);
            SignalStrength ret = new SignalStrength(signalStrength);
            if (responseInfo.error == RadioError.NONE) {
            if (responseInfo.error == RadioError.NONE) {
                sendMessageResponse(rr.mResult, ret);
                sendMessageResponse(rr.mResult, ret);
            }
            }
@@ -1734,7 +1734,7 @@ public class RadioResponse extends IRadioResponse.Stub {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(responseInfo);


        if (rr != null) {
        if (rr != null) {
            SignalStrength ret = RIL.convertHalSignalStrength_1_2(signalStrength);
            SignalStrength ret = new SignalStrength(signalStrength);
            if (responseInfo.error == RadioError.NONE) {
            if (responseInfo.error == RadioError.NONE) {
                sendMessageResponse(rr.mResult, ret);
                sendMessageResponse(rr.mResult, ret);
            }
            }
+3 −38
Original line number Original line Diff line number Diff line
@@ -3190,7 +3190,6 @@ public class ServiceStateTracker extends Handler {
        if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) {
        if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) {
            logRatChange();
            logRatChange();


            updateRatTypeForSignalStrength();
            notifySignalStrength();
            notifySignalStrength();
        }
        }


@@ -4344,53 +4343,19 @@ public class ServiceStateTracker extends Handler {


        if ((ar.exception == null) && (ar.result != null)) {
        if ((ar.exception == null) && (ar.result != null)) {
            mSignalStrength = (SignalStrength) ar.result;
            mSignalStrength = (SignalStrength) ar.result;
            mSignalStrength.validateInput();
            mSignalStrength.setLteRsrpBoost(mSS.getLteEarfcnRsrpBoost());


            PersistableBundle config = getCarrierConfig();
            PersistableBundle config = getCarrierConfig();
            mSignalStrength.setUseOnlyRsrpForLteLevel(config.getBoolean(
            mSignalStrength.updateLevel(config, mSS);
                    CarrierConfigManager.KEY_USE_ONLY_RSRP_FOR_LTE_SIGNAL_BAR_BOOL));
            mSignalStrength.setLteRsrpThresholds(config.getIntArray(
                    CarrierConfigManager.KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY));
            mSignalStrength.setWcdmaDefaultSignalMeasurement(config.getString(
                    CarrierConfigManager.KEY_WCDMA_DEFAULT_SIGNAL_STRENGTH_MEASUREMENT_STRING));
            mSignalStrength.setWcdmaRscpThresholds(config.getIntArray(
                    CarrierConfigManager.KEY_WCDMA_RSCP_THRESHOLDS_INT_ARRAY));
        } else {
        } else {
            log("onSignalStrengthResult() Exception from RIL : " + ar.exception);
            log("onSignalStrengthResult() Exception from RIL : " + ar.exception);
            mSignalStrength = new SignalStrength(true);
            mSignalStrength = new SignalStrength();
        }
        }


        updateRatTypeForSignalStrength();
        boolean ssChanged = notifySignalStrength();
        boolean ssChanged = notifySignalStrength();


        return ssChanged;
        return ssChanged;
    }
    }


    private void updateRatTypeForSignalStrength() {
        if (mSignalStrength != null) {
            boolean isGsm = false;
            int dataRat = mSS.getRilDataRadioTechnology();
            int voiceRat = mSS.getRilVoiceRadioTechnology();

            // Override isGsm based on currently camped data and voice RATs
            // Set isGsm to true if the RAT belongs to GSM family and not IWLAN
            if ((dataRat != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                    && ServiceState.isGsm(dataRat))
                    || (voiceRat != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                    && ServiceState.isGsm(voiceRat))) {
                isGsm = true;
            }

            if (dataRat == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN
                    && voiceRat == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) {
                mSignalStrength.fixType();
            } else {
                mSignalStrength.setGsm(isGsm);
            }
        }
    }

    /**
    /**
     * Hang up all voice call and turn off radio. Implemented by derived class.
     * Hang up all voice call and turn off radio. Implemented by derived class.
     */
     */
@@ -4859,7 +4824,7 @@ public class ServiceStateTracker extends Handler {
    }
    }


    private void setSignalStrengthDefaultValues() {
    private void setSignalStrengthDefaultValues() {
        mSignalStrength = new SignalStrength(true);
        mSignalStrength = new SignalStrength();
    }
    }


    protected String getHomeOperatorNumeric() {
    protected String getHomeOperatorNumeric() {
+15 −30
Original line number Original line Diff line number Diff line
@@ -32,6 +32,11 @@ import android.os.WorkSource;
import android.service.carrier.CarrierIdentifier;
import android.service.carrier.CarrierIdentifier;
import android.telephony.CellInfo;
import android.telephony.CellInfo;
import android.telephony.CellInfoGsm;
import android.telephony.CellInfoGsm;
import android.telephony.CellSignalStrengthCdma;
import android.telephony.CellSignalStrengthGsm;
import android.telephony.CellSignalStrengthLte;
import android.telephony.CellSignalStrengthTdscdma;
import android.telephony.CellSignalStrengthWcdma;
import android.telephony.IccOpenLogicalChannelResponse;
import android.telephony.IccOpenLogicalChannelResponse;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkRegistrationState;
import android.telephony.NetworkRegistrationState;
@@ -858,25 +863,14 @@ public class SimulatedCommands extends BaseCommands


    @Override
    @Override
    public void getSignalStrength (Message result) {
    public void getSignalStrength (Message result) {

        if (mSignalStrength == null) {
        if (mSignalStrength == null) {
            mSignalStrength = new SignalStrength(
            mSignalStrength = new SignalStrength(
                20, // gsmSignalStrength
                    new CellSignalStrengthCdma(),
                0,  // gsmBitErrorRate
                    new CellSignalStrengthGsm(20, 0, CellInfo.UNAVAILABLE),
                -1, // cdmaDbm
                    new CellSignalStrengthWcdma(),
                -1, // cdmaEcio
                    new CellSignalStrengthTdscdma(),
                -1, // evdoDbm
                    new CellSignalStrengthLte());
                -1, // evdoEcio
                -1, // evdoSnr
                99, // lteSignalStrength
                SignalStrength.INVALID,     // lteRsrp
                SignalStrength.INVALID,     // lteRsrq
                SignalStrength.INVALID,     // lteRssnr
                SignalStrength.INVALID,     // lteCqi
                SignalStrength.INVALID      // tdScdmaRscp
            );
        }
        }

        resultSuccess(result, mSignalStrength);
        resultSuccess(result, mSignalStrength);
    }
    }


@@ -2151,20 +2145,11 @@ public class SimulatedCommands extends BaseCommands
    public void notifySignalStrength() {
    public void notifySignalStrength() {
        if (mSignalStrength == null) {
        if (mSignalStrength == null) {
            mSignalStrength = new SignalStrength(
            mSignalStrength = new SignalStrength(
                    20, // gsmSignalStrength
                    new CellSignalStrengthCdma(),
                    0,  // gsmBitErrorRate
                    new CellSignalStrengthGsm(20, 0, CellInfo.UNAVAILABLE),
                    -1, // cdmaDbm
                    new CellSignalStrengthWcdma(),
                    -1, // cdmaEcio
                    new CellSignalStrengthTdscdma(),
                    -1, // evdoDbm
                    new CellSignalStrengthLte());
                    -1, // evdoEcio
                    -1, // evdoSnr
                    99, // lteSignalStrength
                    SignalStrength.INVALID,     // lteRsrp
                    SignalStrength.INVALID,     // lteRsrq
                    SignalStrength.INVALID,     // lteRssnr
                    SignalStrength.INVALID,     // lteCqi
                    SignalStrength.INVALID      // tdScdmaRscp
            );
        }
        }


        if (mSignalStrengthRegistrant != null) {
        if (mSignalStrengthRegistrant != null) {
Loading