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

Commit b11e70ad authored by Jack Yu's avatar Jack Yu
Browse files

Fixed RILTest

Fixed the failed unit tests.

Test: atest RILTest
Change-Id: I37d55c658a383c7595d15c1f45358d3558cbb4c1
parent b4632dee
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ public class RILTest extends TelephonyTest {
    @Mock
    private IOemHook mOemHookProxy;

    private HalVersion mRadioVersion = new HalVersion(1, 0);

    private RilHandler mRilHandler;
    private RIL mRILInstance;
    private RIL mRILUnderTest;
@@ -256,6 +258,11 @@ public class RILTest extends TelephonyTest {
            doReturn(mRadioProxy).when(mRILUnderTest).getRadioProxy(any());
            doReturn(mOemHookProxy).when(mRILUnderTest).getOemHookProxy(any());

            try {
                replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersion);
            } catch (Exception e) {
            }

            mRilHandler = mRILUnderTest.getRilHandler();

            setReady(true);
@@ -712,7 +719,7 @@ public class RILTest extends TelephonyTest {
                mSerialNumberCaptor.capture(),
                eq((DataProfileInfo) invokeMethod(
                        mRILInstance,
                        "convertToHalDataProfile",
                        "convertToHalDataProfile10",
                        new Class<?>[] {DataProfile.class},
                        new Object[] {dataProfile})),
                eq(dataProfile.isPersistent()),
@@ -1023,7 +1030,7 @@ public class RILTest extends TelephonyTest {
                mRILInstance,
                "obtainRequest",
                new Class<?>[] {Integer.TYPE, Message.class, WorkSource.class},
                new Object[] {RIL_REQUEST_GET_SIM_STATUS, obtainMessage(), null});
                new Object[] {RIL_REQUEST_GET_SIM_STATUS, obtainMessage(), new WorkSource()});

        // The wake lock should be held when obtain a RIL request.
        assertTrue(mRILInstance.getWakeLock(RIL.FOR_WAKELOCK).isHeld());