Search in sources :

Example 1 with SmsResponse

use of com.android.internal.telephony.SmsResponse in project android_frameworks_opt_telephony by LineageOS.

the class SimulatedCommands method sendImsCdmaSms.

@Override
public void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response) {
    SimulatedCommandsVerifier.getInstance().sendImsCdmaSms(pdu, retry, messageRef, response);
    resultSuccess(response, new SmsResponse(0, /*messageRef*/
    null, 0));
}
Also used : SmsResponse(com.android.internal.telephony.SmsResponse)

Example 2 with SmsResponse

use of com.android.internal.telephony.SmsResponse in project android_frameworks_opt_telephony by LineageOS.

the class SimulatedCommands method sendSMS.

/**
 * smscPDU is smsc address in PDU form GSM BCD format prefixed
 *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
 * pdu is SMS in PDU format as an ASCII hex string
 *      less the SMSC address
 */
@Override
public void sendSMS(String smscPDU, String pdu, Message result) {
    SimulatedCommandsVerifier.getInstance().sendSMS(smscPDU, pdu, result);
    resultSuccess(result, new SmsResponse(0, /*messageRef*/
    null, 0));
}
Also used : SmsResponse(com.android.internal.telephony.SmsResponse)

Example 3 with SmsResponse

use of com.android.internal.telephony.SmsResponse in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyMetrics method writeOnRilSolicitedResponse.

/**
 * Write RIL solicited response event
 *
 * @param phoneId Phone id
 * @param rilSerial RIL request serial number
 * @param rilError RIL error
 * @param rilRequest RIL request
 * @param ret The returned RIL response
 */
public void writeOnRilSolicitedResponse(int phoneId, int rilSerial, int rilError, int rilRequest, Object ret) {
    switch(rilRequest) {
        case RIL_REQUEST_SETUP_DATA_CALL:
            DataCallResponse dataCall = (DataCallResponse) ret;
            writeOnSetupDataCallResponse(phoneId, rilSerial, rilError, rilRequest, dataCall);
            break;
        case RIL_REQUEST_DEACTIVATE_DATA_CALL:
            writeOnDeactivateDataCallResponse(phoneId, rilError);
            break;
        case RIL_REQUEST_HANGUP:
        case RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND:
        case RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND:
        case RIL_REQUEST_DIAL:
        case RIL_REQUEST_ANSWER:
            writeOnCallSolicitedResponse(phoneId, rilSerial, rilError, rilRequest);
            break;
        case RIL_REQUEST_SEND_SMS:
        case RIL_REQUEST_SEND_SMS_EXPECT_MORE:
        case RIL_REQUEST_CDMA_SEND_SMS:
        case RIL_REQUEST_IMS_SEND_SMS:
            SmsResponse smsResponse = (SmsResponse) ret;
            writeOnSmsSolicitedResponse(phoneId, rilSerial, rilError, smsResponse);
            break;
    }
}
Also used : DataCallResponse(com.android.internal.telephony.dataconnection.DataCallResponse) RilSetupDataCallResponse(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.RilSetupDataCallResponse) SmsResponse(com.android.internal.telephony.SmsResponse)

Example 4 with SmsResponse

use of com.android.internal.telephony.SmsResponse in project android_frameworks_opt_telephony by LineageOS.

the class SimulatedCommands method sendImsGsmSms.

@Override
public void sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef, Message response) {
    SimulatedCommandsVerifier.getInstance().sendImsGsmSms(smscPDU, pdu, retry, messageRef, response);
    resultSuccess(response, new SmsResponse(0, /*messageRef*/
    null, 0));
}
Also used : SmsResponse(com.android.internal.telephony.SmsResponse)

Example 5 with SmsResponse

use of com.android.internal.telephony.SmsResponse in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyMetricsTest method testWriteRilSendSms.

// Test write RIL send SMS
@Test
@SmallTest
public void testWriteRilSendSms() throws Exception {
    mMetrics.writeRilSendSms(mPhone.getPhoneId(), 1, 2, 1);
    mMetrics.writeRilSendSms(mPhone.getPhoneId(), 4, 5, 2);
    SmsResponse response = new SmsResponse(0, null, 123);
    mMetrics.writeOnRilSolicitedResponse(mPhone.getPhoneId(), 1, 0, RIL_REQUEST_SEND_SMS, response);
    response = new SmsResponse(0, null, 456);
    mMetrics.writeOnRilSolicitedResponse(mPhone.getPhoneId(), 4, 0, RIL_REQUEST_SEND_SMS, response);
    TelephonyLog log = buildProto();
    assertEquals(0, log.events.length);
    assertEquals(0, log.callSessions.length);
    assertEquals(1, log.smsSessions.length);
    assertFalse(log.eventsDropped);
    SmsSession.Event[] events = log.smsSessions[0].events;
    assertEquals(4, events.length);
    assertEquals(SmsSession.Event.Type.SMS_SEND, events[0].type);
    assertEquals(1, events[0].rilRequestId);
    assertEquals(2, events[0].tech);
    assertEquals(1, events[0].format);
    assertEquals(SmsSession.Event.Type.SMS_SEND, events[1].type);
    assertEquals(4, events[1].rilRequestId);
    assertEquals(5, events[1].tech);
    assertEquals(2, events[1].format);
    assertEquals(SmsSession.Event.Type.SMS_SEND_RESULT, events[2].type);
    assertEquals(1, events[2].rilRequestId);
    assertEquals(1, events[2].error);
    assertEquals(123, events[2].errorCode);
    assertEquals(SmsSession.Event.Type.SMS_SEND_RESULT, events[3].type);
    assertEquals(4, events[3].rilRequestId);
    assertEquals(1, events[3].error);
    assertEquals(456, events[3].errorCode);
}
Also used : SmsResponse(com.android.internal.telephony.SmsResponse) TelephonyLog(com.android.internal.telephony.nano.TelephonyProto.TelephonyLog) TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) SmallTest(android.test.suitebuilder.annotation.SmallTest) FlakyTest(android.support.test.filters.FlakyTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

SmsResponse (com.android.internal.telephony.SmsResponse)5 FlakyTest (android.support.test.filters.FlakyTest)1 SmallTest (android.test.suitebuilder.annotation.SmallTest)1 TelephonyTest (com.android.internal.telephony.TelephonyTest)1 DataCallResponse (com.android.internal.telephony.dataconnection.DataCallResponse)1 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)1 RilSetupDataCallResponse (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.RilSetupDataCallResponse)1 TelephonyLog (com.android.internal.telephony.nano.TelephonyProto.TelephonyLog)1 Test (org.junit.Test)1