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

Commit db6a3000 authored by Nathan Harold's avatar Nathan Harold Committed by Gerrit Code Review
Browse files

Merge "Refactor CellInfo Constructors"

parents a18ff6ff 896b9b9a
Loading
Loading
Loading
Loading
+10 −68
Original line number Diff line number Diff line
@@ -326,9 +326,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityGsm.size() == 1) {
                        android.hardware.radio.V1_0.CellIdentityGsm cellIdentityGsm =
                                cellIdentity.cellIdentityGsm.get(0);
                        result = new CellIdentityGsm(cellIdentityGsm.lac, cellIdentityGsm.cid,
                                cellIdentityGsm.arfcn, cellIdentityGsm.bsic, cellIdentityGsm.mcc,
                                cellIdentityGsm.mnc, null, null);
                        result = new CellIdentityGsm(cellIdentityGsm);
                    }
                    break;
                }
@@ -336,9 +334,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityWcdma.size() == 1) {
                        android.hardware.radio.V1_0.CellIdentityWcdma cellIdentityWcdma =
                                cellIdentity.cellIdentityWcdma.get(0);
                        result = new CellIdentityWcdma(cellIdentityWcdma.lac, cellIdentityWcdma.cid,
                                cellIdentityWcdma.psc, cellIdentityWcdma.uarfcn,
                                cellIdentityWcdma.mcc, cellIdentityWcdma.mnc, null, null);
                        result = new CellIdentityWcdma(cellIdentityWcdma);
                    }
                    break;
                }
@@ -346,10 +342,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityTdscdma.size() == 1) {
                        android.hardware.radio.V1_0.CellIdentityTdscdma cellIdentityTdscdma =
                                cellIdentity.cellIdentityTdscdma.get(0);
                        result = new  CellIdentityTdscdma(cellIdentityTdscdma.mcc,
                                cellIdentityTdscdma.mnc, cellIdentityTdscdma.lac,
                                cellIdentityTdscdma.cid, cellIdentityTdscdma.cpid,
                                Integer.MAX_VALUE, null, null);
                        result = new  CellIdentityTdscdma(cellIdentityTdscdma);
                    }
                    break;
                }
@@ -357,10 +350,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityLte.size() == 1) {
                        android.hardware.radio.V1_0.CellIdentityLte cellIdentityLte =
                                cellIdentity.cellIdentityLte.get(0);

                        result = new CellIdentityLte(cellIdentityLte.ci, cellIdentityLte.pci,
                                cellIdentityLte.tac, cellIdentityLte.earfcn, Integer.MAX_VALUE,
                                cellIdentityLte.mcc, cellIdentityLte.mnc, null, null);
                        result = new CellIdentityLte(cellIdentityLte);
                    }
                    break;
                }
@@ -368,10 +358,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityCdma.size() == 1) {
                        android.hardware.radio.V1_0.CellIdentityCdma cellIdentityCdma =
                                cellIdentity.cellIdentityCdma.get(0);

                        result = new CellIdentityCdma(cellIdentityCdma.networkId,
                                cellIdentityCdma.systemId, cellIdentityCdma.baseStationId,
                                cellIdentityCdma.longitude, cellIdentityCdma.latitude);
                        result = new CellIdentityCdma(cellIdentityCdma);
                    }
                    break;
                }
@@ -395,16 +382,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityGsm.size() == 1) {
                        android.hardware.radio.V1_2.CellIdentityGsm cellIdentityGsm =
                                cellIdentity.cellIdentityGsm.get(0);

                        result = new CellIdentityGsm(
                                cellIdentityGsm.base.lac,
                                cellIdentityGsm.base.cid,
                                cellIdentityGsm.base.arfcn,
                                cellIdentityGsm.base.bsic,
                                cellIdentityGsm.base.mcc,
                                cellIdentityGsm.base.mnc,
                                cellIdentityGsm.operatorNames.alphaLong,
                                cellIdentityGsm.operatorNames.alphaShort);
                        result = new CellIdentityGsm(cellIdentityGsm);
                    }
                    break;
                }
@@ -412,16 +390,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityWcdma.size() == 1) {
                        android.hardware.radio.V1_2.CellIdentityWcdma cellIdentityWcdma =
                                cellIdentity.cellIdentityWcdma.get(0);

                        result = new CellIdentityWcdma(
                                cellIdentityWcdma.base.lac,
                                cellIdentityWcdma.base.cid,
                                cellIdentityWcdma.base.psc,
                                cellIdentityWcdma.base.uarfcn,
                                cellIdentityWcdma.base.mcc,
                                cellIdentityWcdma.base.mnc,
                                cellIdentityWcdma.operatorNames.alphaLong,
                                cellIdentityWcdma.operatorNames.alphaShort);
                        result = new CellIdentityWcdma(cellIdentityWcdma);
                    }
                    break;
                }
@@ -429,16 +398,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityTdscdma.size() == 1) {
                        android.hardware.radio.V1_2.CellIdentityTdscdma cellIdentityTdscdma =
                                cellIdentity.cellIdentityTdscdma.get(0);

                        result = new  CellIdentityTdscdma(
                                cellIdentityTdscdma.base.mcc,
                                cellIdentityTdscdma.base.mnc,
                                cellIdentityTdscdma.base.lac,
                                cellIdentityTdscdma.base.cid,
                                cellIdentityTdscdma.base.cpid,
                                cellIdentityTdscdma.uarfcn,
                                cellIdentityTdscdma.operatorNames.alphaLong,
                                cellIdentityTdscdma.operatorNames.alphaShort);
                        result = new  CellIdentityTdscdma(cellIdentityTdscdma);
                    }
                    break;
                }
@@ -446,17 +406,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityLte.size() == 1) {
                        android.hardware.radio.V1_2.CellIdentityLte cellIdentityLte =
                                cellIdentity.cellIdentityLte.get(0);

                        result = new CellIdentityLte(
                                cellIdentityLte.base.ci,
                                cellIdentityLte.base.pci,
                                cellIdentityLte.base.tac,
                                cellIdentityLte.base.earfcn,
                                cellIdentityLte.bandwidth,
                                cellIdentityLte.base.mcc,
                                cellIdentityLte.base.mnc,
                                cellIdentityLte.operatorNames.alphaLong,
                                cellIdentityLte.operatorNames.alphaShort);
                        result = new CellIdentityLte(cellIdentityLte);
                    }
                    break;
                }
@@ -464,15 +414,7 @@ public class CellularNetworkService extends NetworkService {
                    if (cellIdentity.cellIdentityCdma.size() == 1) {
                        android.hardware.radio.V1_2.CellIdentityCdma cellIdentityCdma =
                                cellIdentity.cellIdentityCdma.get(0);

                        result = new CellIdentityCdma(
                                cellIdentityCdma.base.networkId,
                                cellIdentityCdma.base.systemId,
                                cellIdentityCdma.base.baseStationId,
                                cellIdentityCdma.base.longitude,
                                cellIdentityCdma.base.latitude,
                                cellIdentityCdma.operatorNames.alphaLong,
                                cellIdentityCdma.operatorNames.alphaShort);
                        result = new CellIdentityCdma(cellIdentityCdma);
                    }
                    break;
                }
+2 −305
Original line number Diff line number Diff line
@@ -26,12 +26,6 @@ import android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo;
import android.hardware.radio.V1_0.CdmaSmsAck;
import android.hardware.radio.V1_0.CdmaSmsMessage;
import android.hardware.radio.V1_0.CdmaSmsWriteArgs;
import android.hardware.radio.V1_0.CellInfoCdma;
import android.hardware.radio.V1_0.CellInfoGsm;
import android.hardware.radio.V1_0.CellInfoLte;
import android.hardware.radio.V1_0.CellInfoTdscdma;
import android.hardware.radio.V1_0.CellInfoType;
import android.hardware.radio.V1_0.CellInfoWcdma;
import android.hardware.radio.V1_0.DataProfileId;
import android.hardware.radio.V1_0.Dial;
import android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo;
@@ -63,7 +57,6 @@ import android.os.Build;
import android.os.Handler;
import android.os.HwBinder;
import android.os.Message;
import android.os.Parcel;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.RemoteException;
@@ -72,13 +65,7 @@ import android.os.SystemProperties;
import android.os.WorkSource;
import android.service.carrier.CarrierIdentifier;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.CellIdentityCdma;
import android.telephony.CellInfo;
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.ImsiEncryptionInfo;
import android.telephony.ModemActivityInfo;
@@ -5402,89 +5389,6 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return lce;
    }

    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForGsm(
            Parcel p, int lac, int cid, int arfcn, int bsic, String mcc, String mnc,
            String al, String as, CellSignalStrengthGsm ss) {
        p.writeInt(CellInfo.TYPE_GSM);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(al);
        p.writeString(as);
        p.writeInt(lac);
        p.writeInt(cid);
        p.writeInt(arfcn);
        p.writeInt(bsic);
        ss.writeToParcel(p, 0);
    }

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

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

        // General CellInfo
        p.writeInt(CellInfo.TYPE_LTE);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(al);
        p.writeString(as);

        // CellIdentity
        p.writeInt(ci);
        p.writeInt(pci);
        p.writeInt(tac);
        p.writeInt(earfcn);
        p.writeInt(bandwidth);

        // CellSignalStrength
        ss.writeToParcel(p, 0);

        // CellConfigLte
        p.writeBoolean(isEndcAvailable);
    }

    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForWcdma(
            Parcel p, int lac, int cid, int psc, int uarfcn, String mcc, String mnc,
            String al, String as, CellSignalStrengthWcdma ss) {
        p.writeInt(CellInfo.TYPE_WCDMA);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(al);
        p.writeString(as);
        p.writeInt(lac);
        p.writeInt(cid);
        p.writeInt(psc);
        p.writeInt(uarfcn);
        ss.writeToParcel(p, 0);
    }

    // TODO(b/119224773) refactor the converter of CellInfo.
    private static void writeToParcelForTdscdma(
            Parcel p, int lac, int cid, int cpid, int uarfcn, String mcc, String mnc,
            String al, String as, CellSignalStrengthTdscdma ss) {
        p.writeInt(CellInfo.TYPE_TDSCDMA);
        p.writeString(mcc);
        p.writeString(mnc);
        p.writeString(al);
        p.writeString(as);
        p.writeInt(lac);
        p.writeInt(cid);
        p.writeInt(cpid);
        p.writeInt(uarfcn);
        ss.writeToParcel(p, 0);
    }

    /**
     * Convert CellInfo defined in 1.0/types.hal to CellInfo type.
     * @param records List of CellInfo defined in 1.0/types.hal
@@ -5496,103 +5400,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size());

        for (android.hardware.radio.V1_0.CellInfo record : records) {
            // first convert RIL CellInfo to Parcel
            Parcel p = Parcel.obtain();
            p.writeInt(record.cellInfoType);
            p.writeInt(record.registered ? 1 : 0);
            p.writeLong(SystemClock.elapsedRealtimeNanos());
            p.writeInt(CellInfo.CONNECTION_UNKNOWN);
            switch (record.cellInfoType) {
                case CellInfoType.GSM: {
                    CellInfoGsm cellInfoGsm = record.gsm.get(0);
                    writeToParcelForGsm(
                            p,
                            cellInfoGsm.cellIdentityGsm.lac,
                            cellInfoGsm.cellIdentityGsm.cid,
                            cellInfoGsm.cellIdentityGsm.arfcn,
                            Byte.toUnsignedInt(cellInfoGsm.cellIdentityGsm.bsic),
                            cellInfoGsm.cellIdentityGsm.mcc,
                            cellInfoGsm.cellIdentityGsm.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            new CellSignalStrengthGsm(cellInfoGsm.signalStrengthGsm));
                    break;
                }

                case CellInfoType.CDMA: {
                    CellInfoCdma cellInfoCdma = record.cdma.get(0);
                    writeToParcelForCdma(
                            p,
                            cellInfoCdma.cellIdentityCdma.networkId,
                            cellInfoCdma.cellIdentityCdma.systemId,
                            cellInfoCdma.cellIdentityCdma.baseStationId,
                            cellInfoCdma.cellIdentityCdma.longitude,
                            cellInfoCdma.cellIdentityCdma.latitude,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            new CellSignalStrengthCdma(
                                    cellInfoCdma.signalStrengthCdma,
                                    cellInfoCdma.signalStrengthEvdo));
                    break;
                }

                case CellInfoType.LTE: {
                    CellInfoLte cellInfoLte = record.lte.get(0);
                    writeToParcelForLte(
                            p,
                            cellInfoLte.cellIdentityLte.ci,
                            cellInfoLte.cellIdentityLte.pci,
                            cellInfoLte.cellIdentityLte.tac,
                            cellInfoLte.cellIdentityLte.earfcn,
                            Integer.MAX_VALUE,
                            cellInfoLte.cellIdentityLte.mcc,
                            cellInfoLte.cellIdentityLte.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            new CellSignalStrengthLte(cellInfoLte.signalStrengthLte),
                            false /* isEndcAvailable */);
                    break;
                }

                case CellInfoType.WCDMA: {
                    CellInfoWcdma cellInfoWcdma = record.wcdma.get(0);
                    writeToParcelForWcdma(
                            p,
                            cellInfoWcdma.cellIdentityWcdma.lac,
                            cellInfoWcdma.cellIdentityWcdma.cid,
                            cellInfoWcdma.cellIdentityWcdma.psc,
                            cellInfoWcdma.cellIdentityWcdma.uarfcn,
                            cellInfoWcdma.cellIdentityWcdma.mcc,
                            cellInfoWcdma.cellIdentityWcdma.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            new CellSignalStrengthWcdma(cellInfoWcdma.signalStrengthWcdma));
                    break;
                }

                case CellInfoType.TD_SCDMA: {
                    CellInfoTdscdma cellInfoTdscdma = record.tdscdma.get(0);
                    writeToParcelForTdscdma(
                            p,
                            cellInfoTdscdma.cellIdentityTdscdma.lac,
                            cellInfoTdscdma.cellIdentityTdscdma.cid,
                            cellInfoTdscdma.cellIdentityTdscdma.cpid,
                            Integer.MAX_VALUE,
                            cellInfoTdscdma.cellIdentityTdscdma.mcc,
                            cellInfoTdscdma.cellIdentityTdscdma.mnc,
                            EMPTY_ALPHA_LONG,
                            EMPTY_ALPHA_SHORT,
                            new CellSignalStrengthTdscdma(cellInfoTdscdma.signalStrengthTdscdma));
                    break;
                }
                default:
                    throw new RuntimeException("unexpected cellinfotype: " + record.cellInfoType);
            }

            p.setDataPosition(0);
            CellInfo InfoRec = CellInfo.CREATOR.createFromParcel(p);
            p.recycle();
            response.add(InfoRec);
            response.add(CellInfo.create(record));
        }

        return response;
@@ -5609,122 +5417,11 @@ public class RIL extends BaseCommands implements CommandsInterface {
        ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size());

        for (android.hardware.radio.V1_2.CellInfo record : records) {
            // first convert RIL CellInfo to Parcel
            Parcel p = Parcel.obtain();
            p.writeInt(record.cellInfoType);
            p.writeInt(record.registered ? 1 : 0);
            p.writeLong(SystemClock.elapsedRealtimeNanos());
            p.writeInt(record.connectionStatus);
            switch (record.cellInfoType) {
                case CellInfoType.GSM: {
                    android.hardware.radio.V1_2.CellInfoGsm cellInfoGsm = record.gsm.get(0);
                    writeToParcelForGsm(
                            p,
                            cellInfoGsm.cellIdentityGsm.base.lac,
                            cellInfoGsm.cellIdentityGsm.base.cid,
                            cellInfoGsm.cellIdentityGsm.base.arfcn,
                            Byte.toUnsignedInt(cellInfoGsm.cellIdentityGsm.base.bsic),
                            cellInfoGsm.cellIdentityGsm.base.mcc,
                            cellInfoGsm.cellIdentityGsm.base.mnc,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaLong,
                            cellInfoGsm.cellIdentityGsm.operatorNames.alphaShort,
                            new CellSignalStrengthGsm(cellInfoGsm.signalStrengthGsm));
                    break;
            response.add(CellInfo.create(record));
        }

                case CellInfoType.CDMA: {
                    android.hardware.radio.V1_2.CellInfoCdma cellInfoCdma = record.cdma.get(0);
                    writeToParcelForCdma(
                            p,
                            cellInfoCdma.cellIdentityCdma.base.networkId,
                            cellInfoCdma.cellIdentityCdma.base.systemId,
                            cellInfoCdma.cellIdentityCdma.base.baseStationId,
                            cellInfoCdma.cellIdentityCdma.base.longitude,
                            cellInfoCdma.cellIdentityCdma.base.latitude,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaLong,
                            cellInfoCdma.cellIdentityCdma.operatorNames.alphaShort,
                            new CellSignalStrengthCdma(
                                cellInfoCdma.signalStrengthCdma,
                                cellInfoCdma.signalStrengthEvdo));
                    break;
                }

                case CellInfoType.LTE: {
                    android.hardware.radio.V1_2.CellInfoLte cellInfoLte = record.lte.get(0);
                    writeToParcelForLte(
                            p,
                            cellInfoLte.cellIdentityLte.base.ci,
                            cellInfoLte.cellIdentityLte.base.pci,
                            cellInfoLte.cellIdentityLte.base.tac,
                            cellInfoLte.cellIdentityLte.base.earfcn,
                            cellInfoLte.cellIdentityLte.bandwidth,
                            cellInfoLte.cellIdentityLte.base.mcc,
                            cellInfoLte.cellIdentityLte.base.mnc,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaLong,
                            cellInfoLte.cellIdentityLte.operatorNames.alphaShort,
                            new CellSignalStrengthLte(cellInfoLte.signalStrengthLte),
                            false /* isEndcAvailable */);
                    break;
                }

                case CellInfoType.WCDMA: {
                    android.hardware.radio.V1_2.CellInfoWcdma cellInfoWcdma = record.wcdma.get(0);
                    writeToParcelForWcdma(
                            p,
                            cellInfoWcdma.cellIdentityWcdma.base.lac,
                            cellInfoWcdma.cellIdentityWcdma.base.cid,
                            cellInfoWcdma.cellIdentityWcdma.base.psc,
                            cellInfoWcdma.cellIdentityWcdma.base.uarfcn,
                            cellInfoWcdma.cellIdentityWcdma.base.mcc,
                            cellInfoWcdma.cellIdentityWcdma.base.mnc,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaLong,
                            cellInfoWcdma.cellIdentityWcdma.operatorNames.alphaShort,
                            new CellSignalStrengthWcdma(cellInfoWcdma.signalStrengthWcdma));
                    break;
                }

                case CellInfoType.TD_SCDMA: {
                    android.hardware.radio.V1_2.CellInfoTdscdma cellInfoTdscdma =
                            record.tdscdma.get(0);
                    writeToParcelForTdscdma(
                            p,
                            cellInfoTdscdma.cellIdentityTdscdma.base.lac,
                            cellInfoTdscdma.cellIdentityTdscdma.base.cid,
                            cellInfoTdscdma.cellIdentityTdscdma.base.cpid,
                            cellInfoTdscdma.cellIdentityTdscdma.uarfcn,
                            cellInfoTdscdma.cellIdentityTdscdma.base.mcc,
                            cellInfoTdscdma.cellIdentityTdscdma.base.mnc,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaLong,
                            cellInfoTdscdma.cellIdentityTdscdma.operatorNames.alphaShort,
                            new CellSignalStrengthTdscdma(cellInfoTdscdma.signalStrengthTdscdma));
                    break;
                }

                default:
                    throw new RuntimeException("unexpected cellinfotype: " + record.cellInfoType);
            }

            p.setDataPosition(0);
            CellInfo InfoRec = CellInfo.CREATOR.createFromParcel(p);
            p.recycle();
            response.add(InfoRec);
        }

        return response;
    }

    private static int convertTdscdmaRscpTo1_2(int rscp) {
        // The HAL 1.0 range is 25..120; the ASU/ HAL 1.2 range is 0..96;
        // yes, this means the range in 1.0 cannot express -24dBm = 96
        if (rscp >= 25 && rscp <= 120) {
            // First we flip the sign to convert from the HALs -rscp to the actual RSCP value.
            int rscpDbm = -rscp;
            // Then to convert from RSCP to ASU, we apply the offset which aligns 0 ASU to -120dBm.
            return rscpDbm + 120;
        }
        return Integer.MAX_VALUE;
    }

    /**
     * @return The {@link IwlanOperationMode IWLAN operation mode}
     */
+2 −37

File changed.

Preview size limit exceeded, changes collapsed.

+2 −36

File changed.

Preview size limit exceeded, changes collapsed.

+5 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.AsyncResult;
import android.os.HandlerThread;
import android.os.Message;
import android.telephony.CellIdentityGsm;
import android.telephony.CellInfo;
import android.telephony.CellInfoGsm;
import android.telephony.ServiceState;
import android.test.suitebuilder.annotation.SmallTest;
@@ -83,8 +84,10 @@ public class LocaleTrackerTest extends TelephonyTest {
        mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);

        mCellInfo = new CellInfoGsm();
        mCellInfo.setCellIdentity(new CellIdentityGsm(Integer.parseInt(US_MCC),
                Integer.parseInt(FAKE_MNC), 0, 0));
        mCellInfo.setCellIdentity(new CellIdentityGsm(
                    CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
                    CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
                    US_MCC, FAKE_MNC, null, null));
        doAnswer(invocation -> {
            Message m = invocation.getArgument(1);
            AsyncResult.forMessage(m, Arrays.asList(mCellInfo), null);
Loading