Search in sources :

Example 1 with SmsWriteArgs

use of android.hardware.radio.V1_0.SmsWriteArgs in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method testWriteSmsToSim.

@FlakyTest
@Test
public void testWriteSmsToSim() throws Exception {
    String smscPdu = "smscPdu";
    String pdu = "pdu";
    int status = SmsManager.STATUS_ON_ICC_READ;
    SmsWriteArgs args = new SmsWriteArgs();
    args.status = 1;
    args.smsc = smscPdu;
    args.pdu = pdu;
    mRILUnderTest.writeSmsToSim(status, smscPdu, pdu, obtainMessage());
    verify(mRadioProxy).writeSmsToSim(mSerialNumberCaptor.capture(), eq(args));
    verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_WRITE_SMS_TO_SIM);
}
Also used : SmsWriteArgs(android.hardware.radio.V1_0.SmsWriteArgs) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 2 with SmsWriteArgs

use of android.hardware.radio.V1_0.SmsWriteArgs in project android_frameworks_opt_telephony by LineageOS.

the class RIL method writeSmsToSim.

@Override
public void writeSmsToSim(int status, String smsc, String pdu, Message result) {
    status = translateStatus(status);
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_WRITE_SMS_TO_SIM, result, mRILDefaultWorkSource);
        if (RILJ_LOGV) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + status);
        }
        SmsWriteArgs args = new SmsWriteArgs();
        args.status = status;
        args.smsc = convertNullToEmptyString(smsc);
        args.pdu = convertNullToEmptyString(pdu);
        try {
            radioProxy.writeSmsToSim(rr.mSerial, args);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "writeSmsToSim", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) SmsWriteArgs(android.hardware.radio.V1_0.SmsWriteArgs) CdmaSmsWriteArgs(android.hardware.radio.V1_0.CdmaSmsWriteArgs)

Aggregations

SmsWriteArgs (android.hardware.radio.V1_0.SmsWriteArgs)2 CdmaSmsWriteArgs (android.hardware.radio.V1_0.CdmaSmsWriteArgs)1 IRadio (android.hardware.radio.V1_0.IRadio)1 RemoteException (android.os.RemoteException)1 FlakyTest (androidx.test.filters.FlakyTest)1 Test (org.junit.Test)1