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

Commit 5b7a8641 authored by Hui Wang's avatar Hui Wang Committed by Gerrit Code Review
Browse files

Merge "Add VoPS support info for NR"

parents 503a4d32 3247e847
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -33,9 +33,11 @@ import android.telephony.LteVopsSupportInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.NetworkService;
import android.telephony.NetworkServiceCallback;
import android.telephony.NrVopsSupportInfo;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.VopsSupportInfo;
import android.text.TextUtils;

import com.android.telephony.Rlog;
@@ -476,9 +478,7 @@ public class CellularNetworkService extends NetworkService {
            boolean isEndcAvailable = false;
            boolean isNrAvailable = false;
            boolean isDcNrRestricted = false;
            LteVopsSupportInfo vopsInfo = new LteVopsSupportInfo(
                    LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE,
                    LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE);
            VopsSupportInfo vopsInfo = null;

            android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo info =
                    regResult.accessTechnologySpecificInfo;
@@ -498,6 +498,13 @@ public class CellularNetworkService extends NetworkService {
                            info.eutranInfo().lteVopsInfo.isVopsSupported,
                            info.eutranInfo().lteVopsInfo.isEmcBearerSupported);
                    break;
                case AccessTechnologySpecificInfo.hidl_discriminator.ngranInfo:
                    android.hardware.radio.V1_6.RegStateResult
                            .AccessTechnologySpecificInfo.NgranRegistrationInfo ngranInfo =
                                    regResult.accessTechnologySpecificInfo.ngranInfo();
                    vopsInfo = new NrVopsSupportInfo(ngranInfo.nrVopsInfo.vopsSupported,
                            ngranInfo.nrVopsInfo.emcSupported, ngranInfo.nrVopsInfo.emfSupported);
                    break;
                case AccessTechnologySpecificInfo.hidl_discriminator.geranInfo:
                    android.hardware.radio.V1_6.RegStateResult
                            .AccessTechnologySpecificInfo.GeranRegistrationInfo geranInfo =
+22 −0
Original line number Diff line number Diff line
@@ -1595,7 +1595,18 @@ public class RIL extends BaseCommands implements CommandsInterface {
            if (RILJ_LOGD) {
                riljLog("getVoiceRegistrationState: overrideHalVersion=" + overrideHalVersion);
            }

            if ((overrideHalVersion == null
                        || overrideHalVersion.greaterOrEqual(RADIO_HAL_VERSION_1_6))
                    && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_6)) {
                final android.hardware.radio.V1_6.IRadio radioProxy16 =
                        (android.hardware.radio.V1_6.IRadio) radioProxy;
                try {
                    radioProxy16.getVoiceRegistrationState_1_6(rr.mSerial);
                } catch (RemoteException | RuntimeException e) {
                    handleRadioProxyExceptionForRR(rr, "getVoiceRegistrationState_1_6", e);
                }
            } else if ((overrideHalVersion == null
                        || overrideHalVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5))
                    && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                final android.hardware.radio.V1_5.IRadio radioProxy15 =
@@ -1628,7 +1639,18 @@ public class RIL extends BaseCommands implements CommandsInterface {
            if (RILJ_LOGD) {
                riljLog("getDataRegistrationState: overrideHalVersion=" + overrideHalVersion);
            }

            if ((overrideHalVersion == null
                        || overrideHalVersion.greaterOrEqual(RADIO_HAL_VERSION_1_6))
                    && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_6)) {
                final android.hardware.radio.V1_6.IRadio radioProxy16 =
                        (android.hardware.radio.V1_6.IRadio) radioProxy;
                try {
                    radioProxy16.getDataRegistrationState_1_6(rr.mSerial);
                } catch (RemoteException | RuntimeException e) {
                    handleRadioProxyExceptionForRR(rr, "getDataRegistrationState_1_6", e);
                }
            } else if ((overrideHalVersion == null
                        || overrideHalVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5))
                    && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                final android.hardware.radio.V1_5.IRadio radioProxy15 =
+275 −1
Original line number Diff line number Diff line
@@ -32,8 +32,10 @@ import android.telephony.LteVopsSupportInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.NetworkService;
import android.telephony.NetworkServiceCallback;
import android.telephony.NrVopsSupportInfo;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.VopsSupportInfo;
import android.test.suitebuilder.annotation.MediumTest;

import com.android.internal.R;
@@ -156,7 +158,7 @@ public class CellularNetworkServiceTest extends TelephonyTest {
            assertTrue(false);
        }

        LteVopsSupportInfo lteVopsSupportInfo =
        VopsSupportInfo lteVopsSupportInfo =
                new LteVopsSupportInfo(LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE,
                        LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE);

@@ -173,4 +175,276 @@ public class CellularNetworkServiceTest extends TelephonyTest {
            assertTrue(false);
        }
    }

    @Test
    @MediumTest
    public void testGetNetworkRegistrationInfoV1_5() {
        // common parameters
        int regState = NetworkRegistrationInfo.REGISTRATION_STATE_HOME;
        int radioTech = ServiceState.RIL_RADIO_TECHNOLOGY_LTE;
        int reasonForDenial = 0;

        // voice services
        List<Integer> availableVoiceServices = new ArrayList<>(Arrays.asList(new Integer[] {
                NetworkRegistrationInfo.SERVICE_TYPE_VOICE,
                NetworkRegistrationInfo.SERVICE_TYPE_SMS,
                NetworkRegistrationInfo.SERVICE_TYPE_VIDEO
        }));

        // Default value per 24.008
        int maxDataCalls = 16;
        // data service
        List<Integer> availableDataServices = Arrays.asList(
                NetworkRegistrationInfo.SERVICE_TYPE_DATA);

        // ENDC parameters
        boolean isEndcAvailable = true;
        boolean isDcNrRestricted = false;
        boolean isNrAvailable = true;

        // LTE VoPS parameters
        boolean isVopsSupported = true;
        boolean isEmcBearerSupported = true;

        android.hardware.radio.V1_5.RegStateResult regResult =
                new android.hardware.radio.V1_5.RegStateResult();

        regResult.regState = regState;
        regResult.rat = radioTech;
        regResult.reasonForDenial = reasonForDenial;

        android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo
                .EutranRegistrationInfo eutranInfo = new android.hardware.radio.V1_5
                .RegStateResult.AccessTechnologySpecificInfo.EutranRegistrationInfo();
        eutranInfo.lteVopsInfo.isVopsSupported = isVopsSupported;
        eutranInfo.lteVopsInfo.isEmcBearerSupported = isEmcBearerSupported;
        eutranInfo.nrIndicators.isEndcAvailable = isEndcAvailable;
        eutranInfo.nrIndicators.isDcNrRestricted = isDcNrRestricted;
        eutranInfo.nrIndicators.isNrAvailable = isNrAvailable;
        regResult.accessTechnologySpecificInfo.eutranInfo(eutranInfo);

        VopsSupportInfo vops = new LteVopsSupportInfo(
                LteVopsSupportInfo.LTE_STATUS_SUPPORTED, LteVopsSupportInfo.LTE_STATUS_SUPPORTED);

        mSimulatedCommands.setVoiceRegStateResult(regResult);
        mSimulatedCommands.setDataRegStateResult(regResult);

        // test voice registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_CS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        NetworkRegistrationInfo expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableVoiceServices, null, "", false, 0, 0, 0);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }

        // test data registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_PS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableDataServices, null, "", maxDataCalls, isDcNrRestricted,
                isNrAvailable, isEndcAvailable, vops);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }
    }

    @Test
    @MediumTest
    public void testGetNetworkRegistrationInfoV1_6WithLte() {
        // common parameters
        int regState = NetworkRegistrationInfo.REGISTRATION_STATE_HOME;
        int radioTech = ServiceState.RIL_RADIO_TECHNOLOGY_LTE;
        int reasonForDenial = 0;

        // voice services
        List<Integer> availableVoiceServices = new ArrayList<>(Arrays.asList(new Integer[] {
                NetworkRegistrationInfo.SERVICE_TYPE_VOICE,
                NetworkRegistrationInfo.SERVICE_TYPE_SMS,
                NetworkRegistrationInfo.SERVICE_TYPE_VIDEO
        }));

        // Default value per 24.008
        int maxDataCalls = 16;
        // data service
        List<Integer> availableDataServices = Arrays.asList(
                NetworkRegistrationInfo.SERVICE_TYPE_DATA);

        // ENDC parameters
        boolean isEndcAvailable = true;
        boolean isDcNrRestricted = false;
        boolean isNrAvailable = true;

        // LTE VoPS parameters
        boolean isVopsSupported = true;
        boolean isEmcBearerSupported = true;

        android.hardware.radio.V1_6.RegStateResult regResult =
                new android.hardware.radio.V1_6.RegStateResult();

        regResult.regState = regState;
        regResult.rat = radioTech;
        regResult.reasonForDenial = reasonForDenial;

        android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo
                .EutranRegistrationInfo eutranInfo = new android.hardware.radio.V1_5
                .RegStateResult.AccessTechnologySpecificInfo.EutranRegistrationInfo();
        eutranInfo.lteVopsInfo.isVopsSupported = isVopsSupported;
        eutranInfo.lteVopsInfo.isEmcBearerSupported = isEmcBearerSupported;
        eutranInfo.nrIndicators.isEndcAvailable = isEndcAvailable;
        eutranInfo.nrIndicators.isDcNrRestricted = isDcNrRestricted;
        eutranInfo.nrIndicators.isNrAvailable = isNrAvailable;
        regResult.accessTechnologySpecificInfo.eutranInfo(eutranInfo);

        VopsSupportInfo vops = new LteVopsSupportInfo(
                LteVopsSupportInfo.LTE_STATUS_SUPPORTED, LteVopsSupportInfo.LTE_STATUS_SUPPORTED);

        mSimulatedCommands.setVoiceRegStateResult(regResult);
        mSimulatedCommands.setDataRegStateResult(regResult);

        // test voice registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_CS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        NetworkRegistrationInfo expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableVoiceServices, null, "", false, 0, 0, 0);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }

        // test data registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_PS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableDataServices, null, "", maxDataCalls, isDcNrRestricted,
                isNrAvailable, isEndcAvailable, vops);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }
    }


    @Test
    @MediumTest
    public void testGetNetworkRegistrationInfoV1_6WithNr() {
        // common parameters
        int regState = NetworkRegistrationInfo.REGISTRATION_STATE_HOME;
        int radioTech = ServiceState.RIL_RADIO_TECHNOLOGY_NR;
        int reasonForDenial = 0;

        // voice services
        List<Integer> availableVoiceServices = new ArrayList<>(Arrays.asList(new Integer[] {
                NetworkRegistrationInfo.SERVICE_TYPE_VOICE,
                NetworkRegistrationInfo.SERVICE_TYPE_SMS,
                NetworkRegistrationInfo.SERVICE_TYPE_VIDEO
        }));

        // Default value per 24.008
        int maxDataCalls = 16;
        // data service
        List<Integer> availableDataServices = Arrays.asList(
                NetworkRegistrationInfo.SERVICE_TYPE_DATA);

        // NR VoPS parameters
        byte vopsSupported = android.hardware.radio.V1_6.VopsIndicator.VOPS_OVER_3GPP;
        byte emcSupported = android.hardware.radio.V1_6.EmcIndicator.EMC_NR_CONNECTED_TO_5GCN;
        byte emfSupported = android.hardware.radio.V1_6.EmfIndicator.EMF_NR_CONNECTED_TO_5GCN;

        android.hardware.radio.V1_6.RegStateResult regResult =
                new android.hardware.radio.V1_6.RegStateResult();

        regResult.regState = regState;
        regResult.rat = radioTech;
        regResult.reasonForDenial = reasonForDenial;


        android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo
                .NgranRegistrationInfo ngranInfo = new android.hardware.radio.V1_6
                .RegStateResult.AccessTechnologySpecificInfo.NgranRegistrationInfo();
        ngranInfo.nrVopsInfo.vopsSupported = vopsSupported;
        ngranInfo.nrVopsInfo.emcSupported = emcSupported;
        ngranInfo.nrVopsInfo.emfSupported = emfSupported;
        regResult.accessTechnologySpecificInfo.ngranInfo(ngranInfo);

        VopsSupportInfo vops = new NrVopsSupportInfo(vopsSupported, emcSupported, emfSupported);
        mSimulatedCommands.setVoiceRegStateResult(regResult);
        mSimulatedCommands.setDataRegStateResult(regResult);

        // test voice registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_CS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        NetworkRegistrationInfo expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableVoiceServices, null, "", false, 0, 0, 0);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }

        // test data registration state
        try {
            mBinder.requestNetworkRegistrationInfo(0, NetworkRegistrationInfo.DOMAIN_PS, mCallback);
        } catch (RemoteException e) {
            assertTrue(false);
        }

        expectedState = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                regState, ServiceState.rilRadioTechnologyToNetworkType(radioTech), reasonForDenial,
                false, availableDataServices, null, "", maxDataCalls, false, false, false, vops);

        try {
            verify(mCallback, timeout(1000).times(1)).onRequestNetworkRegistrationInfoComplete(
                    eq(NetworkServiceCallback.RESULT_SUCCESS), eq(expectedState));
        } catch (RemoteException e) {
            assertTrue(false);
        }
    }
}
+66 −1
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ import android.telephony.INetworkService;
import android.telephony.LteVopsSupportInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.NetworkService;
import android.telephony.NrVopsSupportInfo;
import android.telephony.PhysicalChannelConfig;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
@@ -2370,7 +2371,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {

    @Test
    @SmallTest
    public void testOnVopsInfoChanged() {
    public void testOnLteVopsInfoChanged() {
        ServiceState ss = new ServiceState();
        ss.setVoiceRegState(ServiceState.STATE_IN_SERVICE);
        ss.setDataRegState(ServiceState.STATE_IN_SERVICE);
@@ -2429,6 +2430,70 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                sSnetworkRegistrationInfo.getDataSpecificInfo().getLteVopsSupportInfo());
    }

    @Test
    @SmallTest
    public void testOnNrVopsInfoChanged() {
        ServiceState ss = new ServiceState();
        ss.setVoiceRegState(ServiceState.STATE_IN_SERVICE);
        ss.setDataRegState(ServiceState.STATE_IN_SERVICE);
        sst.mSS = ss;

        CellIdentityLte cellId =
                new CellIdentityLte(1, 1, 5, 1, new int[] {1, 2}, 5000, "001", "01", "test",
                        "tst", Collections.emptyList(), null);
        NrVopsSupportInfo nrVopsSupportInfo = new NrVopsSupportInfo(
                NrVopsSupportInfo.NR_STATUS_VOPS_NOT_SUPPORTED,
                NrVopsSupportInfo.NR_STATUS_EMC_NOT_SUPPORTED,
                NrVopsSupportInfo.NR_STATUS_EMF_NOT_SUPPORTED);

        NetworkRegistrationInfo dataResult = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME, TelephonyManager.NETWORK_TYPE_NR,
                0, false, null, cellId, "00101", 1, false, false, false, nrVopsSupportInfo);
        sst.mPollingContext[0] = 2;

        sst.sendMessage(sst.obtainMessage(
                ServiceStateTracker.EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION,
                new AsyncResult(sst.mPollingContext, dataResult, null)));
        NetworkRegistrationInfo voiceResult = new NetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME,
                TelephonyManager.NETWORK_TYPE_NR, 0,
                false, null, cellId, "00101", false, 0, 0, 0);
        sst.sendMessage(sst.obtainMessage(
                ServiceStateTracker.EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION,
                new AsyncResult(sst.mPollingContext, voiceResult, null)));

        waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
        assertEquals(ServiceState.STATE_IN_SERVICE, sst.getCurrentDataConnectionState());
        NetworkRegistrationInfo sSnetworkRegistrationInfo =
                sst.mSS.getNetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS,
                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
        assertEquals(nrVopsSupportInfo,
                sSnetworkRegistrationInfo.getDataSpecificInfo().getVopsSupportInfo());

        nrVopsSupportInfo = new NrVopsSupportInfo(
                NrVopsSupportInfo.NR_STATUS_VOPS_3GPP_SUPPORTED,
                NrVopsSupportInfo.NR_STATUS_EMC_5GCN_ONLY,
                NrVopsSupportInfo.NR_STATUS_EMF_5GCN_ONLY);
        dataResult = new NetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS,
                AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
                NetworkRegistrationInfo.REGISTRATION_STATE_HOME,
                TelephonyManager.NETWORK_TYPE_NR, 0, false, null, cellId, "00101",
                1, false, false, false, nrVopsSupportInfo);
        sst.mPollingContext[0] = 1;
        sst.sendMessage(sst.obtainMessage(
                ServiceStateTracker.EVENT_POLL_STATE_PS_CELLULAR_REGISTRATION,
                new AsyncResult(sst.mPollingContext, dataResult, null)));
        waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());

        sSnetworkRegistrationInfo =
                sst.mSS.getNetworkRegistrationInfo(2, 1);
        assertEquals(nrVopsSupportInfo,
                sSnetworkRegistrationInfo.getDataSpecificInfo().getVopsSupportInfo());
    }


    @Test
    @SmallTest
    public void testEriLoading() {
+33 −14
Original line number Diff line number Diff line
@@ -164,6 +164,9 @@ public class SimulatedCommands extends BaseCommands
    private IccIoResult mIccIoResultForApduLogicalChannel;
    private int mChannelId = IccOpenLogicalChannelResponse.INVALID_CHANNEL;

    private Object mDataRegStateResult;
    private Object mVoiceRegStateResult;

    int mPausedResponseCount;
    ArrayList<Message> mPausedResponses = new ArrayList<Message>();

@@ -1002,14 +1005,17 @@ public class SimulatedCommands extends BaseCommands
    public void getVoiceRegistrationState(Message result) {
        mGetVoiceRegistrationStateCallCount.incrementAndGet();

        VoiceRegStateResult ret = new VoiceRegStateResult();
        ret.regState = mVoiceRegState;
        ret.rat = mVoiceRadioTech;
        ret.cssSupported = mCssSupported;
        ret.roamingIndicator = mRoamingIndicator;
        ret.systemIsInPrl = mSystemIsInPrl;
        ret.defaultRoamingIndicator = mDefaultRoamingIndicator;
        ret.reasonForDenial = mReasonForDenial;
        Object ret = mVoiceRegStateResult;
        if (ret == null) {
            ret = new VoiceRegStateResult();
            ((VoiceRegStateResult) ret).regState = mVoiceRegState;
            ((VoiceRegStateResult) ret).rat = mVoiceRadioTech;
            ((VoiceRegStateResult) ret).cssSupported = mCssSupported;
            ((VoiceRegStateResult) ret).roamingIndicator = mRoamingIndicator;
            ((VoiceRegStateResult) ret).systemIsInPrl = mSystemIsInPrl;
            ((VoiceRegStateResult) ret).defaultRoamingIndicator = mDefaultRoamingIndicator;
            ((VoiceRegStateResult) ret).reasonForDenial = mReasonForDenial;
        }

        resultSuccess(result, ret);
    }
@@ -1033,11 +1039,14 @@ public class SimulatedCommands extends BaseCommands
    public void getDataRegistrationState(Message result) {
        mGetDataRegistrationStateCallCount.incrementAndGet();

        DataRegStateResult ret = new DataRegStateResult();
        ret.regState = mDataRegState;
        ret.rat = mDataRadioTech;
        ret.maxDataCalls = mMaxDataCalls;
        ret.reasonDataDenied = mReasonForDenial;
        Object ret = mDataRegStateResult;
        if (ret == null) {
            ret = new DataRegStateResult();
            ((DataRegStateResult) ret).regState = mDataRegState;
            ((DataRegStateResult) ret).rat = mDataRadioTech;
            ((DataRegStateResult) ret).maxDataCalls = mMaxDataCalls;
            ((DataRegStateResult) ret).reasonDataDenied = mReasonForDenial;
        }

        resultSuccess(result, ret);
    }
@@ -2435,4 +2444,14 @@ public class SimulatedCommands extends BaseCommands
        SimulatedCommandsVerifier.getInstance().releasePduSessionId(message, pduSessionId);
        resultSuccess(message, null);
    }

    @VisibleForTesting
    public void setDataRegStateResult(Object regStateResult) {
        mDataRegStateResult = regStateResult;
    }

    @VisibleForTesting
    public void setVoiceRegStateResult(Object regStateResult) {
        mVoiceRegStateResult = regStateResult;
    }
}