diff options
5 files changed, 84 insertions, 5 deletions
diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java index 33eed389b615..9b42dbed4e1a 100644 --- a/telephony/java/com/android/internal/telephony/CommandsInterface.java +++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java @@ -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 @@ -1116,9 +1116,20 @@ 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); @@ -1386,6 +1397,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. * * @param accept true if the call is to be accepted, false otherwise. diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 8aae0d428130..e8d85dee8b4a 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -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, @@ -1777,6 +1791,20 @@ public final class RIL extends BaseCommands implements CommandsInterface { /** * {@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} + */ public void handleCallSetupRequestFromSim( boolean accept, Message response) { @@ -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>"; } } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 7fb7f41ad487..ba9d07a609b9 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -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; diff --git a/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java b/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java index 85ce6e0c0f8d..ab010127f143 100644 --- a/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java +++ b/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java @@ -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) { } diff --git a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java index a2a344fc9d49..a0c7d5d114ae 100644 --- a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java +++ b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java @@ -810,6 +810,13 @@ public final class SimulatedCommands extends BaseCommands /** * {@inheritDoc} */ + public void sendEnvelopeWithStatus(String contents, Message response) { + resultSuccess(response, null); + } + + /** + * {@inheritDoc} + */ public void handleCallSetupRequestFromSim( boolean accept, Message response) { resultSuccess(response, null); @@ -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 |