summaryrefslogtreecommitdiffstats
path: root/libril/ril.cpp
diff options
context:
space:
mode:
authorPreeti Ahuja <preetia@codeaurora.org>2011-11-15 12:52:06 -0800
committerAmit Mahajan <amitmahajan@google.com>2014-11-14 12:01:59 -0800
commit61bedcf4f339fb2eecb2e50bbd5637d0b70a9004 (patch)
tree68cadbbfc50ed90aeaae3c29942551091a182a05 /libril/ril.cpp
parent8caf06fd90e877e6c0a4cc1e63bb5b5222704abe (diff)
downloadandroid_hardware_ril-61bedcf4f339fb2eecb2e50bbd5637d0b70a9004.tar.gz
android_hardware_ril-61bedcf4f339fb2eecb2e50bbd5637d0b70a9004.tar.bz2
android_hardware_ril-61bedcf4f339fb2eecb2e50bbd5637d0b70a9004.zip
STK Call Control feature implementation.
Add support for unsols for Stk Call Control feature. Bug: 17646476 Change-Id: I65e8e65e514f00e171086496d86b0c825d3d3d3e
Diffstat (limited to 'libril/ril.cpp')
-rw-r--r--libril/ril.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 8936f36..ef93e5b 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -305,10 +305,14 @@ static int responseCellInfoList(Parcel &p, void *response, size_t responselen);
static int responseHardwareConfig(Parcel &p, void *response, size_t responselen);
static int responseDcRtInfo(Parcel &p, void *response, size_t responselen);
static int responseRadioCapability(Parcel &p, void *response, size_t responselen);
+static int responseSSData(Parcel &p, void *response, size_t responselen);
+
static int decodeVoiceRadioTechnology (RIL_RadioState radioState);
static int decodeCdmaSubscriptionSource (RIL_RadioState radioState);
static RIL_RadioState processRadioState(RIL_RadioState newRadioState);
+static bool isServiceTypeCfQuery(RIL_SsServiceType serType, RIL_SsRequestType reqType);
+
#ifdef RIL_SHLIB
#if defined(ANDROID_MULTI_SIM)
extern "C" void RIL_onUnsolicitedResponse(int unsolResponse, void *data,
@@ -3238,6 +3242,84 @@ static int responseRadioCapability(Parcel &p, void *response, size_t responselen
return 0;
}
+static int responseSSData(Parcel &p, void *response, size_t responselen) {
+ RLOGD("In responseSSData");
+ int num;
+
+ if (response == NULL && responselen != 0) {
+ RLOGE("invalid response length was %d expected %d",
+ (int)responselen, (int)sizeof (RIL_SIM_IO_Response));
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+
+ if (responselen != sizeof(RIL_StkCcUnsolSsResponse)) {
+ RLOGE("invalid response length %d, expected %d",
+ (int)responselen, (int)sizeof(RIL_StkCcUnsolSsResponse));
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+
+ startResponse;
+ RIL_StkCcUnsolSsResponse *p_cur = (RIL_StkCcUnsolSsResponse *) response;
+ p.writeInt32(p_cur->serviceType);
+ p.writeInt32(p_cur->requestType);
+ p.writeInt32(p_cur->teleserviceType);
+ p.writeInt32(p_cur->serviceClass);
+ p.writeInt32(p_cur->result);
+
+ if (isServiceTypeCfQuery(p_cur->serviceType, p_cur->requestType)) {
+ RLOGD("responseSSData CF type, num of Cf elements %d", p_cur->cfData.numValidIndexes);
+ if (p_cur->cfData.numValidIndexes > NUM_SERVICE_CLASSES) {
+ RLOGE("numValidIndexes is greater than max value %d, "
+ "truncating it to max value", NUM_SERVICE_CLASSES);
+ p_cur->cfData.numValidIndexes = NUM_SERVICE_CLASSES;
+ }
+ /* number of call info's */
+ p.writeInt32(p_cur->cfData.numValidIndexes);
+
+ for (int i = 0; i < p_cur->cfData.numValidIndexes; i++) {
+ RIL_CallForwardInfo cf = p_cur->cfData.cfInfo[i];
+
+ p.writeInt32(cf.status);
+ p.writeInt32(cf.reason);
+ p.writeInt32(cf.serviceClass);
+ p.writeInt32(cf.toa);
+ writeStringToParcel(p, cf.number);
+ p.writeInt32(cf.timeSeconds);
+ appendPrintBuf("%s[%s,reason=%d,cls=%d,toa=%d,%s,tout=%d],", printBuf,
+ (cf.status==1)?"enable":"disable", cf.reason, cf.serviceClass, cf.toa,
+ (char*)cf.number, cf.timeSeconds);
+ RLOGD("Data: %d,reason=%d,cls=%d,toa=%d,num=%s,tout=%d],", cf.status,
+ cf.reason, cf.serviceClass, cf.toa, (char*)cf.number, cf.timeSeconds);
+ }
+ } else {
+ p.writeInt32 (SS_INFO_MAX);
+
+ /* each int*/
+ for (int i = 0; i < SS_INFO_MAX; i++) {
+ appendPrintBuf("%s%d,", printBuf, p_cur->ssInfo[i]);
+ RLOGD("Data: %d",p_cur->ssInfo[i]);
+ p.writeInt32(p_cur->ssInfo[i]);
+ }
+ }
+ removeLastChar;
+ closeResponse;
+
+ return 0;
+}
+
+static bool isServiceTypeCfQuery(RIL_SsServiceType serType, RIL_SsRequestType reqType) {
+ if ((reqType == SS_INTERROGATION) &&
+ (serType == SS_CFU ||
+ serType == SS_CF_BUSY ||
+ serType == SS_CF_NO_REPLY ||
+ serType == SS_CF_NOT_REACHABLE ||
+ serType == SS_CF_ALL ||
+ serType == SS_CF_ALL_CONDITIONAL)) {
+ return true;
+ }
+ return false;
+}
+
static void triggerEvLoop() {
int ret;
if (!pthread_equal(pthread_self(), s_tid_dispatch)) {