summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaoyi Chen <xychen.xiaoyi@gmail.com>2021-12-16 17:30:38 +0800
committerDenis Kenzior <denkenz@gmail.com>2021-12-16 11:20:46 -0600
commitce2a661f0b93a6cf404807d922ccbde98dc43bbb (patch)
treea9aae14422f5e7dea5bbc7bcc400e328594a16ff
parent637031a7855d1d03e00f68abeb199ee08f216eb6 (diff)
downloadofono-ce2a661f0b93a6cf404807d922ccbde98dc43bbb.tar.gz
rilmodem: fix a problem that manager_dial_callback is never called
This problem does not happen each time when dialing. It's only observed with some sim cards under certain network. The time sequence to reproduce the problem is: - send dial request - receive unsol event call state changed - send clcc poll request - clcc poll response (vd->cb is null here) - dial response - setup vd->cb (then it never gets called)
-rw-r--r--drivers/rilmodem/voicecall.c12
-rw-r--r--drivers/rilmodem/voicecall.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/rilmodem/voicecall.c b/drivers/rilmodem/voicecall.c
index 6c169166..1fce4a3a 100644
--- a/drivers/rilmodem/voicecall.c
+++ b/drivers/rilmodem/voicecall.c
@@ -396,6 +396,8 @@ static void rild_cb(struct ril_msg *message, gpointer user_data)
* DIAL_MODIFIED_TO_DIAL means redirection. The call we will see when
* polling will have a different called number.
*/
+ vd->suppress_clcc_poll = FALSE;
+
if (message->error == RIL_E_SUCCESS ||
(g_ril_vendor(vd->ril) == OFONO_RIL_VENDOR_AOSP &&
message->error == RIL_E_DIAL_MODIFIED_TO_DIAL)) {
@@ -448,8 +450,10 @@ static void dial(struct ofono_voicecall *vc,
/* Send request to RIL */
if (g_ril_send(vd->ril, RIL_REQUEST_DIAL, &rilp,
- rild_cb, cbd, g_free) > 0)
+ rild_cb, cbd, g_free) > 0) {
+ vd->suppress_clcc_poll = TRUE;
return;
+ }
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
@@ -594,6 +598,11 @@ void ril_call_state_notify(struct ril_msg *message, gpointer user_data)
g_ril_print_unsol_no_args(vd->ril, message);
+ if (vd->suppress_clcc_poll) {
+ DBG("suppress clcc poll!");
+ return;
+ }
+
/* Just need to request the call list again */
ril_poll_clcc(vc);
@@ -829,6 +838,7 @@ int ril_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
vd->vendor = vendor;
vd->cb = NULL;
vd->data = NULL;
+ vd->suppress_clcc_poll = FALSE;
clear_dtmf_queue(vd);
diff --git a/drivers/rilmodem/voicecall.h b/drivers/rilmodem/voicecall.h
index 31e120e3..beb25104 100644
--- a/drivers/rilmodem/voicecall.h
+++ b/drivers/rilmodem/voicecall.h
@@ -31,6 +31,7 @@ struct ril_voicecall_data {
void *data;
gchar *tone_queue;
gboolean tone_pending;
+ gboolean suppress_clcc_poll;
};
int ril_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,