Skip to content

Commit

Permalink
[ril] Retry data call on PDP_FAIL_ERROR_UNSPECIFIED. Fixes JB#35406
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
monich committed Jun 7, 2016
1 parent 5e23459 commit 9cae262
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions ofono/drivers/ril/ril_data.c
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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");
Expand Down

0 comments on commit 9cae262

Please sign in to comment.