Skip to content

Commit 0948540

Browse files
author
Jake Hamby
committed
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
1 parent 79235d2 commit 0948540

File tree

5 files changed

+84
-5
lines changed

5 files changed

+84
-5
lines changed

telephony/java/com/android/internal/telephony/CommandsInterface.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public boolean isCdma() {
292292
void setOnNewGsmBroadcastSms(Handler h, int what, Object obj);
293293
void unSetOnNewGsmBroadcastSms(Handler h);
294294

295-
/**
295+
/**
296296
* Register for NEW_SMS_ON_SIM unsolicited message
297297
*
298298
* AsyncResult.result is an int array containing the index of new SMS
@@ -1115,10 +1115,21 @@ public boolean isCdma() {
11151115

11161116
void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response);
11171117

1118+
/**
1119+
* Acknowledge successful or failed receipt of last incoming SMS,
1120+
* including acknowledgement TPDU to send as the RP-User-Data element
1121+
* of the RP-ACK or RP-ERROR PDU.
1122+
*
1123+
* @param success true to send RP-ACK, false to send RP-ERROR
1124+
* @param ackPdu the acknowledgement TPDU in hexadecimal format
1125+
* @param response sent when operation completes.
1126+
*/
1127+
void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response);
1128+
11181129
/**
11191130
* parameters equivalent to 27.007 AT+CRSM command
11201131
* response.obj will be an AsyncResult
1121-
* response.obj.userObj will be a IccIoResult on success
1132+
* response.obj.result will be an IccIoResult on success
11221133
*/
11231134
void iccIO (int command, int fileid, String path, int p1, int p2, int p3,
11241135
String data, String pin2, Message response);
@@ -1385,6 +1396,22 @@ void setFacilityLockForApp(String facility, boolean lockState, String password,
13851396
*/
13861397
public void sendEnvelope(String contents, Message response);
13871398

1399+
/**
1400+
* Send ENVELOPE to the SIM, such as an SMS-PP data download envelope
1401+
* for a SIM data download message. This method has one difference
1402+
* from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response
1403+
* are returned along with the response data.
1404+
*
1405+
* response.obj will be an AsyncResult
1406+
* response.obj.result will be an IccIoResult on success
1407+
*
1408+
* @param contents String containing SAT/USAT response in hexadecimal
1409+
* format starting with command tag. See TS 102 223 for
1410+
* details.
1411+
* @param response Callback message
1412+
*/
1413+
public void sendEnvelopeWithStatus(String contents, Message response);
1414+
13881415
/**
13891416
* Accept or reject the call setup request from SIM.
13901417
*

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,20 @@ private int translateStatus(int status) {
14071407
send(rr);
14081408
}
14091409

1410+
public void
1411+
acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message result) {
1412+
RILRequest rr
1413+
= RILRequest.obtain(RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU, result);
1414+
1415+
rr.mp.writeInt(2);
1416+
rr.mp.writeString(success ? "1" : "0");
1417+
rr.mp.writeString(ackPdu);
1418+
1419+
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
1420+
+ ' ' + success + " [" + ackPdu + ']');
1421+
1422+
send(rr);
1423+
}
14101424

14111425
public void
14121426
iccIO (int command, int fileid, String path, int p1, int p2, int p3,
@@ -1774,6 +1788,20 @@ public void sendEnvelope(String contents, Message response) {
17741788
send(rr);
17751789
}
17761790

1791+
/**
1792+
* {@inheritDoc}
1793+
*/
1794+
public void sendEnvelopeWithStatus(String contents, Message response) {
1795+
RILRequest rr = RILRequest.obtain(
1796+
RILConstants.RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS, response);
1797+
1798+
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
1799+
+ '[' + contents + ']');
1800+
1801+
rr.mp.writeString(contents);
1802+
send(rr);
1803+
}
1804+
17771805
/**
17781806
* {@inheritDoc}
17791807
*/
@@ -2245,6 +2273,8 @@ private RILRequest findAndRemoveRequestFromList(int serial) {
22452273
case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break;
22462274
case RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE: ret = responseInts(p); break;
22472275
case RIL_REQUEST_ISIM_AUTHENTICATION: ret = responseString(p); break;
2276+
case RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU: ret = responseVoid(p); break;
2277+
case RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS: ret = responseICC_IO(p); break;
22482278
default:
22492279
throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest);
22502280
//break;
@@ -2870,7 +2900,7 @@ private void notifyRegistrantsRilConnectionChanged(int rilVer) {
28702900

28712901

28722902
private Object
2873-
responseICC_IO(Parcel p) {
2903+
responseICC_IO(Parcel p) {
28742904
int sw1, sw2;
28752905
byte data[] = null;
28762906
Message ret;
@@ -3112,8 +3142,8 @@ private DataCallState getDataCallState(Parcel p, int version) {
31123142
return ret;
31133143
}
31143144

3115-
private Object
3116-
responseCellList(Parcel p) {
3145+
private Object
3146+
responseCellList(Parcel p) {
31173147
int num, rssi;
31183148
String location;
31193149
ArrayList<NeighboringCellInfo> response;
@@ -3452,6 +3482,8 @@ private Object responseGmsBroadcastConfig(Parcel p) {
34523482
case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: return "RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING";
34533483
case RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE: return "RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE";
34543484
case RIL_REQUEST_ISIM_AUTHENTICATION: return "RIL_REQUEST_ISIM_AUTHENTICATION";
3485+
case RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU: return "RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU";
3486+
case RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS: return "RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS";
34553487
default: return "<unknown request>";
34563488
}
34573489
}

telephony/java/com/android/internal/telephony/RILConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ class C */
262262
int RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103;
263263
int RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE = 104;
264264
int RIL_REQUEST_ISIM_AUTHENTICATION = 105;
265+
int RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106;
266+
int RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107;
265267
int RIL_UNSOL_RESPONSE_BASE = 1000;
266268
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
267269
int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001;

telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ public void acknowledgeLastIncomingCdmaSms(boolean success, int cause,
206206
Message result) {
207207
}
208208

209+
public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu,
210+
Message result) {
211+
}
209212

210213
public void iccIO (int command, int fileid, String path, int p1, int p2,
211214
int p3, String data, String pin2, Message result) {
@@ -298,6 +301,9 @@ public void sendTerminalResponse(String contents, Message response) {
298301
public void sendEnvelope(String contents, Message response) {
299302
}
300303

304+
public void sendEnvelopeWithStatus(String contents, Message response) {
305+
}
306+
301307
public void handleCallSetupRequestFromSim(
302308
boolean accept, Message response) {
303309
}

telephony/java/com/android/internal/telephony/test/SimulatedCommands.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,13 @@ public void sendEnvelope(String contents, Message response) {
807807
resultSuccess(response, null);
808808
}
809809

810+
/**
811+
* {@inheritDoc}
812+
*/
813+
public void sendEnvelopeWithStatus(String contents, Message response) {
814+
resultSuccess(response, null);
815+
}
816+
810817
/**
811818
* {@inheritDoc}
812819
*/
@@ -1037,6 +1044,11 @@ public void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message r
10371044
unimplemented(result);
10381045
}
10391046

1047+
public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu,
1048+
Message result) {
1049+
unimplemented(result);
1050+
}
1051+
10401052
/**
10411053
* parameters equivalent to 27.007 AT+CRSM command
10421054
* response.obj will be an AsyncResult

0 commit comments

Comments
 (0)