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

Commit 62ca5909 authored by Sarah Chin's avatar Sarah Chin
Browse files

Query radio capabilities on carrier config changed

Some capabilities are SIM dependent (ie. whether 5G is supported),
so send a request to get the new radio capabilities when the carrier
config changes.

Test: atest FrameworksTelephonyTests
Bug: 169788770
Change-Id: I55ebd0f6b77c9d292273723f72f3f3f6bfe267d6
Merged-In: I55ebd0f6b77c9d292273723f72f3f3f6bfe267d6
parent 23d02b01
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2773,6 +2773,8 @@ public class GsmCdmaPhone extends Phone {
                break;

            case EVENT_CARRIER_CONFIG_CHANGED:
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
                // Only check for the voice radio tech if it not going to be updated by the voice
                // registration changes.
                if (!mContext.getResources().getBoolean(
+11 −0
Original line number Diff line number Diff line
@@ -1375,4 +1375,15 @@ public class GsmCdmaPhoneTest extends TelephonyTest {

        replaceInstance(Phone.class, "mImsPhone", mPhoneUT, mImsPhone);
    }

    @Test
    public void testEventCarrierConfigChanged() {
        mPhoneUT.mCi = mMockCi;
        mPhoneUT.sendMessage(mPhoneUT.obtainMessage(Phone.EVENT_CARRIER_CONFIG_CHANGED));
        processAllMessages();

        ArgumentCaptor<Message> captor = ArgumentCaptor.forClass(Message.class);
        verify(mMockCi).getRadioCapability(captor.capture());
        assertEquals(captor.getValue().what, Phone.EVENT_GET_RADIO_CAPABILITY);
    }
}