Add new RIL requests to support SIM data download via SMS over IMS.

On an LTE device where incoming SMS messages over IMS are sent to
the framework via RIL_UNSOL_RESPONSE_NEW_SMS responses sent to
the RIL, it may be necessary to process USIM data download SM's
(message class 2). This requires the RIL to implement two new requests.

1) RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS:
   send an ENVELOPE command to the UICC, receiving the SW1 and SW2
   status bytes in addition to the command response.

2) RIL_REQUEST_SMS_ACKNOWLEDGE_WITH_PDU:
   send an RP-ACK or RP-ERROR acknowledgement to the incoming SM,
   including an acknowledgement PDU containing the envelope response.

Change-Id: If597a14fa8c4780c75da84fa96c49abcb05960f2
This commit is contained in:
Jake Hamby
2011-09-26 00:42:16 -07:00
parent 79235d2a93
commit 094854091b
5 changed files with 84 additions and 5 deletions

View File

@@ -292,7 +292,7 @@ public interface CommandsInterface {
void setOnNewGsmBroadcastSms(Handler h, int what, Object obj);
void unSetOnNewGsmBroadcastSms(Handler h);
/**
/**
* Register for NEW_SMS_ON_SIM unsolicited message
*
* AsyncResult.result is an int array containing the index of new SMS
@@ -1115,10 +1115,21 @@ public interface CommandsInterface {
void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response);
/**
* Acknowledge successful or failed receipt of last incoming SMS,
* including acknowledgement TPDU to send as the RP-User-Data element
* of the RP-ACK or RP-ERROR PDU.
*
* @param success true to send RP-ACK, false to send RP-ERROR
* @param ackPdu the acknowledgement TPDU in hexadecimal format
* @param response sent when operation completes.
*/
void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response);
/**
* parameters equivalent to 27.007 AT+CRSM command
* response.obj will be an AsyncResult
* response.obj.userObj will be a IccIoResult on success
* response.obj.result will be an IccIoResult on success
*/
void iccIO (int command, int fileid, String path, int p1, int p2, int p3,
String data, String pin2, Message response);
@@ -1385,6 +1396,22 @@ public interface CommandsInterface {
*/
public void sendEnvelope(String contents, Message response);
/**
* Send ENVELOPE to the SIM, such as an SMS-PP data download envelope
* for a SIM data download message. This method has one difference
* from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response
* are returned along with the response data.
*
* response.obj will be an AsyncResult
* response.obj.result will be an IccIoResult on success
*
* @param contents String containing SAT/USAT response in hexadecimal
* format starting with command tag. See TS 102 223 for
* details.
* @param response Callback message
*/
public void sendEnvelopeWithStatus(String contents, Message response);
/**
* Accept or reject the call setup request from SIM.
*

View File

@@ -1407,6 +1407,20 @@ public final class RIL extends BaseCommands implements CommandsInterface {
send(rr);
}
public void
acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message result) {
RILRequest rr
= RILRequest.obtain(RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU, result);
rr.mp.writeInt(2);
rr.mp.writeString(success ? "1" : "0");
rr.mp.writeString(ackPdu);
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ ' ' + success + " [" + ackPdu + ']');
send(rr);
}
public void
iccIO (int command, int fileid, String path, int p1, int p2, int p3,
@@ -1774,6 +1788,20 @@ public final class RIL extends BaseCommands implements CommandsInterface {
send(rr);
}
/**
* {@inheritDoc}
*/
public void sendEnvelopeWithStatus(String contents, Message response) {
RILRequest rr = RILRequest.obtain(
RILConstants.RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS, response);
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ '[' + contents + ']');
rr.mp.writeString(contents);
send(rr);
}
/**
* {@inheritDoc}
*/
@@ -2245,6 +2273,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break;
case RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE: ret = responseInts(p); break;
case RIL_REQUEST_ISIM_AUTHENTICATION: ret = responseString(p); break;
case RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU: ret = responseVoid(p); break;
case RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS: ret = responseICC_IO(p); break;
default:
throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest);
//break;
@@ -2870,7 +2900,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
private Object
responseICC_IO(Parcel p) {
responseICC_IO(Parcel p) {
int sw1, sw2;
byte data[] = null;
Message ret;
@@ -3112,8 +3142,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
return ret;
}
private Object
responseCellList(Parcel p) {
private Object
responseCellList(Parcel p) {
int num, rssi;
String location;
ArrayList<NeighboringCellInfo> response;
@@ -3452,6 +3482,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: return "RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING";
case RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE: return "RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE";
case RIL_REQUEST_ISIM_AUTHENTICATION: return "RIL_REQUEST_ISIM_AUTHENTICATION";
case RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU: return "RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU";
case RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS: return "RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS";
default: return "<unknown request>";
}
}

View File

@@ -262,6 +262,8 @@ cat include/telephony/ril.h | \
int RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103;
int RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE = 104;
int RIL_REQUEST_ISIM_AUTHENTICATION = 105;
int RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106;
int RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107;
int RIL_UNSOL_RESPONSE_BASE = 1000;
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001;

View File

@@ -206,6 +206,9 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
Message result) {
}
public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu,
Message result) {
}
public void iccIO (int command, int fileid, String path, int p1, int p2,
int p3, String data, String pin2, Message result) {
@@ -298,6 +301,9 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
public void sendEnvelope(String contents, Message response) {
}
public void sendEnvelopeWithStatus(String contents, Message response) {
}
public void handleCallSetupRequestFromSim(
boolean accept, Message response) {
}

View File

@@ -807,6 +807,13 @@ public final class SimulatedCommands extends BaseCommands
resultSuccess(response, null);
}
/**
* {@inheritDoc}
*/
public void sendEnvelopeWithStatus(String contents, Message response) {
resultSuccess(response, null);
}
/**
* {@inheritDoc}
*/
@@ -1037,6 +1044,11 @@ public final class SimulatedCommands extends BaseCommands
unimplemented(result);
}
public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu,
Message result) {
unimplemented(result);
}
/**
* parameters equivalent to 27.007 AT+CRSM command
* response.obj will be an AsyncResult