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

Commit 4aa5be2e authored by Pengquan Meng's avatar Pengquan Meng Committed by android-build-merger
Browse files

Merge "Add 5G NSA information to opt/telephony" am: 0455898a

am: 2250ce57

Change-Id: I0b9482a77dbf507375c2960a67b2a0013ccae721
parents be5887ae 2250ce57
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -275,7 +275,9 @@ public class CellularNetworkService extends NetworkService {

                return new NetworkRegistrationState(domain, transportType, regState,
                        accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices,
                        cellIdentity, maxDataCalls);
                        cellIdentity, maxDataCalls, false /* isDcNrRestricted */,
                        false /* isNrAvailable */);

            } else if (result instanceof android.hardware.radio.V1_2.DataRegStateResult) {
                android.hardware.radio.V1_2.DataRegStateResult dataRegState =
                        (android.hardware.radio.V1_2.DataRegStateResult) result;
@@ -290,7 +292,26 @@ public class CellularNetworkService extends NetworkService {

                return new NetworkRegistrationState(domain, transportType, regState,
                        accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices,
                        cellIdentity, maxDataCalls);
                        cellIdentity, maxDataCalls, false /* isDcNrRestricted */,
                        false /* isNrAvailable */);
            } else if (result instanceof android.hardware.radio.V1_3.DataRegStateResult) {
                android.hardware.radio.V1_3.DataRegStateResult dataRegState =
                        (android.hardware.radio.V1_3.DataRegStateResult) result;
                int regState = getRegStateFromHalRegState(dataRegState.base.regState);
                int accessNetworkTechnology = getAccessNetworkTechnologyFromRat(
                        dataRegState.base.rat);
                int reasonForDenial = dataRegState.base.reasonDataDenied;
                boolean emergencyOnly = isEmergencyOnly(dataRegState.base.regState);
                int maxDataCalls = dataRegState.base.maxDataCalls;
                int[] availableServices = getAvailableServices(regState, domain, emergencyOnly);
                CellIdentity cellIdentity =
                        convertHalCellIdentityToCellIdentity(dataRegState.base.cellIdentity);
                boolean isDcNrRestricted = dataRegState.isDcNrRestricted;
                boolean isNrAvailable = dataRegState.isNrAvailable;
                return new NetworkRegistrationState(domain, transportType, regState,
                        accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices,
                        cellIdentity, maxDataCalls, isDcNrRestricted, isNrAvailable);

            }

            return null;
+20 −3
Original line number Diff line number Diff line
@@ -5391,6 +5391,7 @@ 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, int ss, int ber, int ta) {
@@ -5408,6 +5409,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(ta);
    }

    // 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,
            int dbm, int ecio, int eDbm, int eEcio, int eSnr) {
@@ -5415,27 +5417,39 @@ public class RIL extends BaseCommands implements CommandsInterface {
        new CellSignalStrengthCdma(dbm, ecio, eDbm, eEcio, eSnr).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, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta) {
            String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta,
            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
        p.writeInt(ss);
        p.writeInt(rsrp);
        p.writeInt(rsrq);
        p.writeInt(rssnr);
        p.writeInt(cqi);
        p.writeInt(ta);

        // 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, int ss, int ber, int rscp, int ecno) {
@@ -5454,6 +5468,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        p.writeInt(ecno);
    }

    // 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, int ss, int ber, int rscp) {
@@ -5544,7 +5559,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoLte.signalStrengthLte.rsrq,
                            cellInfoLte.signalStrengthLte.rssnr,
                            cellInfoLte.signalStrengthLte.cqi,
                            cellInfoLte.signalStrengthLte.timingAdvance);
                            cellInfoLte.signalStrengthLte.timingAdvance,
                            false /* isEndcAvailable */);
                    break;
                }

@@ -5670,7 +5686,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            cellInfoLte.signalStrengthLte.rsrq,
                            cellInfoLte.signalStrengthLte.rssnr,
                            cellInfoLte.signalStrengthLte.cqi,
                            cellInfoLte.signalStrengthLte.timingAdvance);
                            cellInfoLte.signalStrengthLte.timingAdvance,
                            false /* isEndcAvailable */);
                    break;
                }

+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ public class CellularNetworkServiceTest extends TelephonyTest {
        expectedState = new NetworkRegistrationState(
                domain, AccessNetworkConstants.TransportType.WWAN, voiceRegState,
                ServiceState.rilRadioTechnologyToNetworkType(voiceRadioTech), reasonForDenial,
                false, availableServices, null, maxDataCalls);
                false, availableServices, null, maxDataCalls, false, false);

        try {
            verify(mCallback, times(1)).onGetNetworkRegistrationStateComplete(
+2 −4
Original line number Diff line number Diff line
@@ -291,8 +291,7 @@ public class ServiceStateTest extends TestCase {

        NetworkRegistrationState wwanDataRegState = new NetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN,
                0, 0, 0, false,
                null, null, 0);
                0, 0, 0, false, null, null, 0, false, false);

        NetworkRegistrationState wlanRegState = new NetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN,
@@ -314,8 +313,7 @@ public class ServiceStateTest extends TestCase {

        wwanDataRegState = new NetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN,
                0, 0, 0, true,
                null, null, 0);
                0, 0, 0, true, null, null, 0, false, false);
        ss.addNetworkRegistrationState(wwanDataRegState);
        assertEquals(ss.getNetworkRegistrationStates(NetworkRegistrationState.DOMAIN_PS,
                AccessNetworkConstants.TransportType.WWAN), wwanDataRegState);
+5 −3
Original line number Diff line number Diff line
@@ -1656,7 +1656,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {

    private void changeRegState(int state, CellIdentity cid, int voiceRat, int dataRat) {
        NetworkRegistrationState dataResult = new NetworkRegistrationState(
                0, 0, state, dataRat, 0, false, null, cid, 1);
                0, 0, state, dataRat, 0, false, null, cid, 1, false, false);
        sst.mPollingContext[0] = 2;
        // update data reg state to be in service
        sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_POLL_STATE_GPRS,
@@ -1741,7 +1741,8 @@ public class ServiceStateTrackerTest extends TelephonyTest {

    private void sendRegStateUpdateForLteCellId(CellIdentityLte cellId) {
        NetworkRegistrationState dataResult = new NetworkRegistrationState(
                2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1);
                2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1,
                false, false);
        NetworkRegistrationState voiceResult = new NetworkRegistrationState(
                1, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId,
                false, 0, 0, 0);
@@ -1804,7 +1805,8 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    public void testPhyChanBandwidthResetsOnOos() throws Exception {
        testPhyChanBandwidthRatchetedOnPhyChanBandwidth();
        NetworkRegistrationState dataResult = new NetworkRegistrationState(
                2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1);
                2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1, false,
                false);
        NetworkRegistrationState voiceResult = new NetworkRegistrationState(
                1, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null,
                false, 0, 0, 0);