use of android.hardware.radio.V1_0.ImsSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendRetryImsCdmaSms.
@FlakyTest
@Test
public void testSendRetryImsCdmaSms() throws Exception {
CdmaSmsMessage cdmaMsg = new CdmaSmsMessage();
ImsSmsMessage firstMsg = new ImsSmsMessage();
firstMsg.tech = RILConstants.CDMA_PHONE;
firstMsg.retry = false;
firstMsg.messageRef = 0;
firstMsg.cdmaMessage.add(cdmaMsg);
ImsSmsMessage retryMsg = new ImsSmsMessage();
retryMsg.tech = RILConstants.CDMA_PHONE;
retryMsg.retry = true;
retryMsg.messageRef = 0;
retryMsg.cdmaMessage.add(cdmaMsg);
int maxRetryCount = 3;
int firstTransmission = 0;
byte[] pdu = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (int i = 0; i <= maxRetryCount; i++) {
mRILUnderTest.sendImsCdmaSms(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.ImsSmsMessage 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.ImsSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendImsCdmaSms.
@Override
public void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_IMS_SEND_SMS, result, mRILDefaultWorkSource);
// Do not log function args for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
ImsSmsMessage msg = new ImsSmsMessage();
msg.tech = RILConstants.CDMA_PHONE;
msg.retry = (byte) retry >= 1 ? true : false;
msg.messageRef = messageRef;
CdmaSmsMessage cdmaMsg = new CdmaSmsMessage();
constructCdmaSendSmsRilRequest(cdmaMsg, pdu);
msg.cdmaMessage.add(cdmaMsg);
try {
radioProxy.sendImsSms(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS, SmsSession.Event.Format.SMS_FORMAT_3GPP2);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendImsCdmaSms", e);
}
}
}
use of android.hardware.radio.V1_0.ImsSmsMessage in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendImsGsmSms.
@Override
public void sendImsGsmSms(String smscPdu, String pdu, int retry, int messageRef, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_IMS_SEND_SMS, result, mRILDefaultWorkSource);
// Do not log function args for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
ImsSmsMessage msg = new ImsSmsMessage();
msg.tech = RILConstants.GSM_PHONE;
msg.retry = (byte) retry >= 1 ? true : false;
msg.messageRef = messageRef;
GsmSmsMessage gsmMsg = constructGsmSendSmsRilRequest(smscPdu, pdu);
msg.gsmMessage.add(gsmMsg);
try {
radioProxy.sendImsSms(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS, SmsSession.Event.Format.SMS_FORMAT_3GPP);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendImsGsmSms", e);
}
}
}
Aggregations