summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreeti Ahuja <preetia@codeaurora.org>2014-04-03 15:47:47 -0700
committerRicardo Cerqueira <ricardo@cyngn.com>2014-10-21 15:00:08 -0700
commitdecb970301fd1333d9ad82c44d0e7617f29bd57c (patch)
tree3094dc2f4c4a8954f063bdec4036933b3857dfa7
parent523ebb23427f35567f8bb40911ce99668b820e3d (diff)
downloadandroid_hardware_ril-decb970301fd1333d9ad82c44d0e7617f29bd57c.tar.gz
android_hardware_ril-decb970301fd1333d9ad82c44d0e7617f29bd57c.tar.bz2
android_hardware_ril-decb970301fd1333d9ad82c44d0e7617f29bd57c.zip
Support for SEEK on Android
Support the following ril requests to enable SEEK on Android: 1. RIL_REQUEST_SIM_TRNASMIT_BASIC 2. RIL_REQUEST_SIM_OPEN_CHANNEL 3. RIL_REQUEST_SIM_CLOSE_CHANNEL 4. RIL_REQUEST_SIM_TRANSMIT_CHANNEL 5. RIL_REQUEST_SIM_GET_ATR Change-Id: Ie3f457d7a18f52a3452e3d2f50d40a4b70754cc4
-rw-r--r--include/telephony/ril.h96
-rw-r--r--[-rwxr-xr-x]libril/ril.cpp16
-rw-r--r--libril/ril_commands.h5
3 files changed, 116 insertions, 1 deletions
diff --git a/include/telephony/ril.h b/include/telephony/ril.h
index 6d7ac40..3d6620a 100644
--- a/include/telephony/ril.h
+++ b/include/telephony/ril.h
@@ -83,7 +83,10 @@ typedef enum {
RIL_E_SS_MODIFIED_TO_DIAL = 23, /* SS request modified to DIAL */
RIL_E_SS_MODIFIED_TO_USSD = 24, /* SS request modified to USSD */
RIL_E_SS_MODIFIED_TO_SS = 25, /* SS request modified to different SS request */
- RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26 /* Subscription not supported by RIL */
+ RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26, /* Subscription not supported by RIL */
+ RIL_E_MISSING_RESOURCE = 27, /* No logical channel available */
+ RIL_E_NO_SUCH_ELEMENT = 28, /* Application not found on sim */
+ RIL_E_INVALID_PARAMETER = 29 /* TO DO: add description*/
} RIL_Errno;
typedef enum {
@@ -332,6 +335,9 @@ typedef struct {
} RIL_Dial;
typedef struct {
+#ifdef RIL_SUPPORTS_SEEK
+ int cla;
+#endif
int command; /* one of the commands listed for TS 27.007 +CRSM*/
int fileid; /* EF id */
char *path; /* "pathid" from TS 27.007 +CRSM command.
@@ -346,6 +352,9 @@ typedef struct {
} RIL_SIM_IO_v5;
typedef struct {
+#ifdef RIL_SUPPORTS_SEEK
+ int cla;
+#endif
int command; /* one of the commands listed for TS 27.007 +CRSM*/
int fileid; /* EF id */
char *path; /* "pathid" from TS 27.007 +CRSM command.
@@ -3801,6 +3810,91 @@ typedef struct {
*/
#define RIL_REQUEST_SET_DATA_SUBSCRIPTION 116
+/**
+ * RIL_REQUEST_SIM_TRANSMIT_BASIC
+ *
+ * Request APDU exchange on the basic channel.
+ *
+ * "data" is a const RIL_SIM_IO *
+ *
+ * "response" is a const RIL_SIM_IO_Response *
+ *
+ * Valid errors:
+ *
+ * SUCCESS
+ * TO DO: add erros
+ */
+#define RIL_REQUEST_SIM_TRANSMIT_BASIC 117
+
+/**
+ * RIL_REQUEST_SIM_OPEN_CHANNEL
+ *
+ * Open a new logical channel.
+ *
+ * "data" is a const char * containing the AID of the applet
+ *
+ * "response" is a int * containing the channel id
+ *
+ * Valid errors:
+ *
+ * SUCCESS
+ * TO DO: add erros
+ */
+#define RIL_REQUEST_SIM_OPEN_CHANNEL 118
+
+/**
+ * RIL_REQUEST_SIM_CLOSE_CHANNEL
+ *
+ * Close a previoulsy opened logical channel.
+ *
+ * "data" is a const int * containing the channel id
+ *
+ * "response" is NULL
+ *
+ * Valid errors:
+ *
+ * SUCCESS
+ * TO DO: add erros
+ */
+#define RIL_REQUEST_SIM_CLOSE_CHANNEL 119
+
+/**
+ * RIL_REQUEST_SIM_TRANSMIT_CHANNEL
+ *
+ * Exchange APDUs with a UICC over a previously opened logical channel.
+ *
+ * "data" is a const RIL_SIM_IO_v7_CAF *
+ *
+ * "response" is a const RIL_SIM_IO_Response *
+ *
+ * Valid errors:
+ *
+ * SUCCESS
+ * TO DO: add erros
+ */
+#define RIL_REQUEST_SIM_TRANSMIT_CHANNEL 120
+
+/**
+ * RIL_REQUEST_SIM_GET_ATR
+ *
+ * Get the ATR from SIM Card
+ *
+ * Only valid when radio state is "RADIO_STATE_ON"
+ *
+ * "data" is const int *
+ * ((const int *)data)[0] contains the slot index on the SIM from which ATR is requested.
+ *
+ * "response" is a const char * containing the ATR, See ETSI 102.221 8.1 and ISO/IEC 7816 3
+ *
+ * Valid errors:
+ *
+ * SUCCESS
+ * RADIO_NOT_AVAILABLE (radio resetting)
+ * GENERIC_FAILURE
+ */
+
+#define RIL_REQUEST_SIM_GET_ATR 121
+
/***********************************************************************/
diff --git a/libril/ril.cpp b/libril/ril.cpp
index c2aa344..ac38da3 100755..100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -713,6 +713,7 @@ invalid:
/**
* Callee expects const RIL_SIM_IO *
* Payload is:
+ * int32_t cla
* int32_t command
* int32_t fileid
* String path
@@ -736,6 +737,15 @@ dispatchSIM_IO (Parcel &p, RequestInfo *pRI) {
// note we only check status at the end
+#ifdef RIL_SUPPORTS_SEEK
+ simIO.v6.cla = 0;
+ if(pRI->pCI->requestNumber == RIL_REQUEST_SIM_TRANSMIT_BASIC ||
+ pRI->pCI->requestNumber == RIL_REQUEST_SIM_TRANSMIT_CHANNEL ) {
+ status = p.readInt32(&t);
+ simIO.v6.cla = (int)t;
+ }
+#endif
+
status = p.readInt32(&t);
simIO.v6.command = (int)t;
@@ -762,6 +772,7 @@ dispatchSIM_IO (Parcel &p, RequestInfo *pRI) {
simIO.v6.command, simIO.v6.fileid, (char*)simIO.v6.path,
simIO.v6.p1, simIO.v6.p2, simIO.v6.p3,
(char*)simIO.v6.data, (char*)simIO.v6.pin2, simIO.v6.aidPtr);
+
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
@@ -3978,6 +3989,11 @@ requestToString(int request) {
case RIL_REQUEST_SEND_SMS_EXPECT_MORE: return "SEND_SMS_EXPECT_MORE";
case RIL_REQUEST_SETUP_DATA_CALL: return "SETUP_DATA_CALL";
case RIL_REQUEST_SIM_IO: return "SIM_IO";
+ case RIL_REQUEST_SIM_TRANSMIT_BASIC: return "SIM_TRANSMIT_BASIC";
+ case RIL_REQUEST_SIM_OPEN_CHANNEL: return "SIM_OPEN_CHANNEL";
+ case RIL_REQUEST_SIM_CLOSE_CHANNEL: return "SIM_CLOSE_CHANNEL";
+ case RIL_REQUEST_SIM_TRANSMIT_CHANNEL: return "SIM_TRANSMIT_CHANNEL";
+ case RIL_REQUEST_SIM_GET_ATR: return "SIM_GET_ATR";
case RIL_REQUEST_SEND_USSD: return "SEND_USSD";
case RIL_REQUEST_CANCEL_USSD: return "CANCEL_USSD";
case RIL_REQUEST_GET_CLIR: return "GET_CLIR";
diff --git a/libril/ril_commands.h b/libril/ril_commands.h
index bd68a06..ca5a144 100644
--- a/libril/ril_commands.h
+++ b/libril/ril_commands.h
@@ -135,3 +135,8 @@
{RIL_REQUEST_GET_DATA_CALL_PROFILE, dispatchInts, responseGetDataCallProfile},
{RIL_REQUEST_SET_UICC_SUBSCRIPTION, dispatchUiccSubscripton, responseVoid},
{RIL_REQUEST_SET_DATA_SUBSCRIPTION, dispatchVoid, responseVoid},
+ {RIL_REQUEST_SIM_TRANSMIT_BASIC, dispatchSIM_IO, responseSIM_IO},
+ {RIL_REQUEST_SIM_OPEN_CHANNEL, dispatchString, responseInts},
+ {RIL_REQUEST_SIM_CLOSE_CHANNEL, dispatchInts, responseVoid},
+ {RIL_REQUEST_SIM_TRANSMIT_CHANNEL, dispatchSIM_IO, responseSIM_IO},
+ {RIL_REQUEST_SIM_GET_ATR, dispatchInts, responseString},