summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2009-12-22 15:35:41 -0800
committerWink Saville <wink@google.com>2009-12-22 15:35:41 -0800
commit74fa38884320698c1623764850e3131b9769dff0 (patch)
treed632c43fd96f9d022b15454f435e763c6aadd2f2
parent8ebaff8bec727eab4cdc2ae3090dde9465a16081 (diff)
downloadandroid_hardware_ril-74fa38884320698c1623764850e3131b9769dff0.tar.gz
android_hardware_ril-74fa38884320698c1623764850e3131b9769dff0.tar.bz2
android_hardware_ril-74fa38884320698c1623764850e3131b9769dff0.zip
ril interface: Add support for User-User Signaling Information during call setup
Define the UUS data structures and add a pointer to it in RIL_Call for MT Calls and RIL_Dial for MO calls. UUS information can be used to pass the skypeId on some networks. Make the corresponding changes to serialize and deserialize the data at the RIL interface. Change-Id: Ibbd471cd062910fd4c365f76e809cfb224bd34a2
-rw-r--r--include/telephony/ril.h39
-rw-r--r--libril/ril.cpp64
-rw-r--r--reference-ril/reference-ril.c2
3 files changed, 100 insertions, 5 deletions
diff --git a/include/telephony/ril.h b/include/telephony/ril.h
index e921fa6..c988fe4 100644
--- a/include/telephony/ril.h
+++ b/include/telephony/ril.h
@@ -40,7 +40,7 @@
extern "C" {
#endif
-#define RIL_VERSION 2
+#define RIL_VERSION 3
#define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
#define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
@@ -94,7 +94,40 @@ typedef enum {
RADIO_STATE_NV_READY = 9 /* Radio is on and the NV interface is available */
} RIL_RadioState;
- /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
+/* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
+typedef enum {
+ RIL_UUS_TYPE1_IMPLICIT = 0,
+ RIL_UUS_TYPE1_REQUIRED = 1,
+ RIL_UUS_TYPE1_NOT_REQUIRED = 2,
+ RIL_UUS_TYPE2_REQUIRED = 3,
+ RIL_UUS_TYPE2_NOT_REQUIRED = 4,
+ RIL_UUS_TYPE3_REQUIRED = 5,
+ RIL_UUS_TYPE3_NOT_REQUIRED = 6
+} RIL_UUS_Type;
+
+/* User-to-User Signaling Information data coding schemes. Possible values for
+ * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
+ * specified in section 10.5.4.25 of 3GPP TS 24.008 */
+typedef enum {
+ RIL_UUS_DCS_USP = 0, /* User specified protocol */
+ RIL_UUS_DCS_OSIHLP = 1, /* OSI higher layer protocol */
+ RIL_UUS_DCS_X244 = 2, /* X.244 */
+ RIL_UUS_DCS_RMCF = 3, /* Reserved for system mangement
+ convergence function */
+ RIL_UUS_DCS_IA5c = 4 /* IA5 characters */
+} RIL_UUS_DCS;
+
+/* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
+ * This data is passed in RIL_ExtensionRecord and rec contains this
+ * structure when type is RIL_UUS_INFO_EXT_REC */
+typedef struct {
+ RIL_UUS_Type uusType; /* UUS Type */
+ RIL_UUS_DCS uusDcs; /* UUS Data Coding Scheme */
+ int uusLength; /* Length of UUS Data */
+ char * uusData; /* UUS Data */
+} RIL_UUS_Info;
+
+/* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
typedef struct {
char isPresent; /* non-zero if signal information record is present */
char signalType; /* as defined 3.7.5.5-1 */
@@ -116,6 +149,7 @@ typedef struct {
int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
char * name; /* Remote party name */
int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
+ RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */
} RIL_Call;
typedef struct {
@@ -158,6 +192,7 @@ typedef struct {
* clir == 1 on "CLIR invocation" (restrict CLI presentation)
* clir == 2 on "CLIR suppression" (allow CLI presentation)
*/
+ RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */
} RIL_Dial;
typedef struct {
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 6f36b8d..8a93a54 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -570,7 +570,9 @@ invalid:
static void
dispatchDial (Parcel &p, RequestInfo *pRI) {
RIL_Dial dial;
+ RIL_UUS_Info uusInfo;
int32_t t;
+ int32_t uusPresent;
status_t status;
memset (&dial, 0, sizeof(dial));
@@ -584,8 +586,53 @@ dispatchDial (Parcel &p, RequestInfo *pRI) {
goto invalid;
}
+ if (s_callbacks.version < 3) { // STOP_SHIP: Remove when partners upgrade to version 3
+ uusPresent = 0;
+ } else {
+ status = p.readInt32(&uusPresent);
+
+ if (status != NO_ERROR) {
+ goto invalid;
+ }
+
+ if (uusPresent == 0) {
+ dial.uusInfo = NULL;
+ } else {
+ int32_t len;
+
+ memset(&uusInfo, 0, sizeof(RIL_UUS_Info));
+
+ status = p.readInt32(&t);
+ uusInfo.uusType = (RIL_UUS_Type) t;
+
+ status = p.readInt32(&t);
+ uusInfo.uusDcs = (RIL_UUS_DCS) t;
+
+ status = p.readInt32(&len);
+ if (status != NO_ERROR) {
+ goto invalid;
+ }
+
+ // The java code writes -1 for null arrays
+ if (((int) len) == -1) {
+ uusInfo.uusData = NULL;
+ len = 0;
+ } else {
+ uusInfo.uusData = (char*) p.readInplace(len);
+ }
+
+ uusInfo.uusLength = len;
+ dial.uusInfo = &uusInfo;
+ }
+ }
+
startRequest;
appendPrintBuf("%snum=%s,clir=%d", printBuf, dial.address, dial.clir);
+ if (uusPresent) {
+ appendPrintBuf("%s,uusType=%d,uusDcs=%d,uusLen=%d", printBuf,
+ dial.uusInfo->uusType, dial.uusInfo->uusDcs,
+ dial.uusInfo->uusLength);
+ }
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
@@ -598,6 +645,7 @@ dispatchDial (Parcel &p, RequestInfo *pRI) {
free (dial.address);
#ifdef MEMSET_FREED
+ memset(&uusInfo, 0, sizeof(RIL_UUS_Info));
memset(&dial, 0, sizeof(dial));
#endif
@@ -1323,6 +1371,17 @@ static int responseCallList(Parcel &p, void *response, size_t responselen) {
p.writeInt32(p_cur->numberPresentation);
writeStringToParcel(p, p_cur->name);
p.writeInt32(p_cur->namePresentation);
+ // STOP_SHIP: Remove when partners upgrade to version 3
+ if ((s_callbacks.version < 3) || (p_cur->uusInfo == NULL || p_cur->uusInfo->uusData == NULL)) {
+ p.writeInt32(0); /* UUS Information is absent */
+ } else {
+ RIL_UUS_Info *uusInfo = p_cur->uusInfo;
+ p.writeInt32(1); /* UUS Information is present */
+ p.writeInt32(uusInfo->uusType);
+ p.writeInt32(uusInfo->uusDcs);
+ p.writeInt32(uusInfo->uusLength);
+ p.write(uusInfo->uusData, uusInfo->uusLength);
+ }
appendPrintBuf("%s[id=%d,%s,toa=%d,",
printBuf,
p_cur->index,
@@ -2463,9 +2522,8 @@ RIL_register (const RIL_RadioFunctions *callbacks) {
int ret;
int flags;
- if (callbacks == NULL
- || ! (callbacks->version == RIL_VERSION || callbacks->version == 1)
- ) {
+ if (callbacks == NULL || ((callbacks->version != RIL_VERSION)
+ && (callbacks->version != 2))) } // STOP_SHIP: Remove when partners upgrade to version 3
LOGE(
"RIL_register: RIL_RadioFunctions * null or invalid version"
" (expected %d)", RIL_VERSION);
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c
index 65170fc..633ad8b 100644
--- a/reference-ril/reference-ril.c
+++ b/reference-ril/reference-ril.c
@@ -200,6 +200,8 @@ static int callFromCLCCLine(char *line, RIL_Call *p_call)
if (err < 0) goto error;
}
+ p_call->uusInfo = NULL;
+
return 0;
error: