summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-11-04 13:27:58 +0100
committerPaul Kocialkowski <contact@paulk.fr>2012-11-04 13:27:58 +0100
commit2924bed3e740327f2c48c8d2508b1ba1e76a120a (patch)
tree3bd8e6e1e66ae6bb798528fe7988cc38dad90a11
parent62bda30666b8e47d3eae48b0d0431e65a33e36ab (diff)
downloadhardware_ril_samsung-ril-2924bed3e740327f2c48c8d2508b1ba1e76a120a.zip
hardware_ril_samsung-ril-2924bed3e740327f2c48c8d2508b1ba1e76a120a.tar.gz
hardware_ril_samsung-ril-2924bed3e740327f2c48c8d2508b1ba1e76a120a.tar.bz2
SMS: Process next incoming message after failure
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--samsung-ril.h1
-rw-r--r--sms.c26
2 files changed, 17 insertions, 10 deletions
diff --git a/samsung-ril.h b/samsung-ril.h
index c67dd63..af7313f 100644
--- a/samsung-ril.h
+++ b/samsung-ril.h
@@ -334,6 +334,7 @@ int ipc_sms_incoming_msg_register(char *pdu, int length, unsigned char type, uns
void ipc_sms_incoming_msg_unregister(struct ipc_sms_incoming_msg_info *incoming_msg);
struct ipc_sms_incoming_msg_info *ipc_sms_incoming_msg_info_find(void);
+void ipc_sms_incoming_msg_next(void);
void ipc_sms_incoming_msg_complete(char *pdu, int length, unsigned char type, unsigned char tpid);
void ipc_sms_incoming_msg(struct ipc_message_info *info);
void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length);
diff --git a/sms.c b/sms.c
index 39da237..43e3c28 100644
--- a/sms.c
+++ b/sms.c
@@ -609,6 +609,20 @@ list_continue:
* Notify RILJ about the incoming message
*/
+void ipc_sms_incoming_msg_next(void)
+{
+ struct ipc_sms_incoming_msg_info *incoming_msg;
+
+ ril_data.state.sms_incoming_msg_tpid = 0;
+
+ incoming_msg = ipc_sms_incoming_msg_info_find();
+ if(incoming_msg == NULL)
+ return;
+
+ ipc_sms_incoming_msg_complete(incoming_msg->pdu, incoming_msg->length, incoming_msg->type, incoming_msg->tpid);
+ ipc_sms_incoming_msg_unregister(incoming_msg);
+}
+
void ipc_sms_incoming_msg_complete(char *pdu, int length, unsigned char type, unsigned char tpid)
{
if(pdu == NULL || length <= 0)
@@ -668,7 +682,6 @@ void ipc_sms_incoming_msg(struct ipc_message_info *info)
*/
void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length)
{
- struct ipc_sms_incoming_msg_info *incoming_msg;
struct ipc_sms_deliver_report_request report_msg;
int success, fail_cause;
@@ -681,7 +694,7 @@ void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length)
if(ril_data.state.sms_incoming_msg_tpid == 0) {
LOGE("There is no SMS message to ACK!");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
-
+ ipc_sms_incoming_msg_next();
return;
}
@@ -694,14 +707,7 @@ void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length)
ipc_fmt_send(IPC_SMS_DELIVER_REPORT, IPC_TYPE_EXEC, (void *) &report_msg, sizeof(report_msg), ril_request_get_id(t));
- ril_data.state.sms_incoming_msg_tpid = 0;
-
- incoming_msg = ipc_sms_incoming_msg_info_find();
- if(incoming_msg == NULL)
- return;
-
- ipc_sms_incoming_msg_complete(incoming_msg->pdu, incoming_msg->length, incoming_msg->type, incoming_msg->tpid);
- ipc_sms_incoming_msg_unregister(incoming_msg);
+ ipc_sms_incoming_msg_next();
}
/**