use of android.hardware.radio.V1_0.GsmSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendSMS.
@Override
public void sendSMS(String smscPdu, String pdu, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SEND_SMS, result, mRILDefaultWorkSource);
// Do not log function args for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
GsmSmsMessage msg = constructGsmSendSmsRilRequest(smscPdu, pdu);
try {
radioProxy.sendSms(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_GSM, SmsSession.Event.Format.SMS_FORMAT_3GPP);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendSMS", e);
}
}
}
use of android.hardware.radio.V1_0.GsmSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendRetryImsGsmSms.
@FlakyTest
@Test
public void testSendRetryImsGsmSms() throws Exception {
String smscPdu = "smscPdu";
String pdu = "pdu";
GsmSmsMessage gsmMsg = new GsmSmsMessage();
gsmMsg.smscPdu = smscPdu;
gsmMsg.pdu = pdu;
ImsSmsMessage firstMsg = new ImsSmsMessage();
firstMsg.tech = RILConstants.GSM_PHONE;
firstMsg.retry = false;
firstMsg.messageRef = 0;
firstMsg.gsmMessage.add(gsmMsg);
ImsSmsMessage retryMsg = new ImsSmsMessage();
retryMsg.tech = RILConstants.GSM_PHONE;
retryMsg.retry = true;
retryMsg.messageRef = 0;
retryMsg.gsmMessage.add(gsmMsg);
int maxRetryCount = 3;
int firstTransmission = 0;
for (int i = 0; i <= maxRetryCount; i++) {
mRILUnderTest.sendImsGsmSms(smscPdu, pdu, i, 0, obtainMessage());
if (i == firstTransmission) {
verify(mRadioProxy, times(1)).sendImsSms(mSerialNumberCaptor.capture(), eq(firstMsg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
} else {
verify(mRadioProxy, times(i)).sendImsSms(mSerialNumberCaptor.capture(), eq(retryMsg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
}
}
}
use of android.hardware.radio.V1_0.GsmSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendSMSExpectMore.
@FlakyTest
@Test
public void testSendSMSExpectMore() throws Exception {
String smscPdu = "smscPdu";
String pdu = "pdu";
GsmSmsMessage msg = new GsmSmsMessage();
msg.smscPdu = smscPdu;
msg.pdu = pdu;
mRILUnderTest.sendSMSExpectMore(smscPdu, pdu, obtainMessage());
verify(mRadioProxy).sendSMSExpectMore(mSerialNumberCaptor.capture(), eq(msg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SEND_SMS_EXPECT_MORE);
}
use of android.hardware.radio.V1_0.GsmSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendSMSExpectMore.
@Override
public void sendSMSExpectMore(String smscPdu, String pdu, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SEND_SMS_EXPECT_MORE, result, mRILDefaultWorkSource);
// Do not log function arg for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
GsmSmsMessage msg = constructGsmSendSmsRilRequest(smscPdu, pdu);
try {
radioProxy.sendSMSExpectMore(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_GSM, SmsSession.Event.Format.SMS_FORMAT_3GPP);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendSMSExpectMore", e);
}
}
}
use of android.hardware.radio.V1_0.GsmSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendSMS.
@FlakyTest
@Test
public void testSendSMS() throws Exception {
String smscPdu = "smscPdu";
String pdu = "pdu";
GsmSmsMessage msg = new GsmSmsMessage();
msg.smscPdu = smscPdu;
msg.pdu = pdu;
mRILUnderTest.sendSMS(smscPdu, pdu, obtainMessage());
verify(mRadioProxy).sendSms(mSerialNumberCaptor.capture(), eq(msg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SEND_SMS);
}
Aggregations