From 9cae262c80e38e93edaeb34650366c4c848fca26 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 5 Jun 2016 12:15:50 +0300 Subject: [PATCH] [ril] Retry data call on PDP_FAIL_ERROR_UNSPECIFIED. Fixes JB#35406 According to comment in android's ril.h, if data call setup fails with status PDP_FAIL_ERROR_UNSPECIFIED, then we need to silently retry the call. --- ofono/drivers/ril/ril_data.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ofono/drivers/ril/ril_data.c b/ofono/drivers/ril/ril_data.c index 8c3b4ac93..4cbf6dbe6 100644 --- a/ofono/drivers/ril/ril_data.c +++ b/ofono/drivers/ril/ril_data.c @@ -158,6 +158,7 @@ struct ril_data_request_setup { char *password; enum ofono_gprs_proto proto; enum ofono_gprs_auth_method auth_method; + int retry_count; }; struct ril_data_request_deact { @@ -686,8 +687,6 @@ static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status, struct ril_data_call_list *list = NULL; struct ril_data_call *call = NULL; - ril_data_request_completed(req); - if (ril_status == RIL_E_SUCCESS) { list = ril_data_call_list_parse(data, len); } @@ -701,6 +700,22 @@ static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status, } } + if (call && call->status == PDP_FAIL_ERROR_UNSPECIFIED && + !setup->retry_count) { + /* + * Retry silently according to comment in ril.h + * (no more than once though) + */ + DBG("retrying silently"); + setup->retry_count++; + req->pending_id = 0; + req->submit(req); + ril_data_call_list_free(list); + return; + } + + ril_data_request_completed(req); + if (call && call->status == PDP_FAIL_NONE) { if (ril_data_call_list_move_calls(self->data_calls, list) > 0) { DBG("data call(s) added");