Commit 4d916785 authored by Slava Monich's avatar Slava Monich

[ril] Don't use RIL_REQUEST_GET_CELL_INFO_LIST at all. JB#42820

Its use is not critical (sooner or later rild will report currently
known cells with RIL_UNSOL_CELL_INFO_LIST) and yet there are reasons
to believe that RIL_REQUEST_GET_CELL_INFO_LIST breaks rild on some
systems when submitted too soon after radio has been powered on.
parent 26e39508
/*
* oFono - Open Source Telephony - RIL-based devices
*
* Copyright (C) 2016-2018 Jolla Ltd.
* Copyright (C) 2016-2019 Jolla Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -46,7 +46,6 @@ struct ril_cell_info {
gboolean sim_card_ready;
char *log_prefix;
gulong event_id;
guint query_id;
guint set_rate_id;
};
......@@ -324,18 +323,6 @@ static void ril_cell_info_list_changed_cb(GRilIoChannel *io, guint code,
(io->ril_version, data, len));
}
static void ril_cell_info_list_cb(GRilIoChannel *io, int status,
const void *data, guint len, void *user_data)
{
struct ril_cell_info *self = RIL_CELL_INFO(user_data);
DBG_(self, "");
GASSERT(self->query_id);
self->query_id = 0;
ril_cell_info_update_cells(self, (status == RIL_E_SUCCESS) ?
ril_cell_info_parse_list(io->ril_version, data, len) : NULL);
}
static void ril_cell_info_set_rate_cb(GRilIoChannel *io, int status,
const void *data, guint len, void *user_data)
{
......@@ -346,18 +333,6 @@ static void ril_cell_info_set_rate_cb(GRilIoChannel *io, int status,
self->set_rate_id = 0;
}
static void ril_cell_info_query(struct ril_cell_info *self)
{
GRilIoRequest *req = grilio_request_new();
grilio_request_set_retry(req, RIL_RETRY_MS, MAX_RETRIES);
grilio_channel_cancel_request(self->io, self->query_id, FALSE);
self->query_id = grilio_channel_send_request_full(self->io, req,
RIL_REQUEST_GET_CELL_INFO_LIST, ril_cell_info_list_cb,
NULL, self);
grilio_request_unref(req);
}
static void ril_cell_info_set_rate(struct ril_cell_info *self, int ms)
{
GRilIoRequest *req = grilio_request_sized_new(8);
......@@ -386,22 +361,14 @@ static void ril_cell_info_display_state_cb(MceDisplay *display, void *arg)
ril_cell_info_update_rate(RIL_CELL_INFO(arg));
}
static void ril_cell_info_refresh(struct ril_cell_info *self)
{
/* RIL_REQUEST_GET_CELL_INFO_LIST fails without SIM card */
if (self->radio->state == RADIO_STATE_ON && self->sim_card_ready) {
ril_cell_info_query(self);
} else {
ril_cell_info_update_cells(self, NULL);
}
}
static void ril_cell_info_radio_state_cb(struct ril_radio *radio, void *arg)
{
struct ril_cell_info *self = RIL_CELL_INFO(arg);
DBG_(self, "%s", ril_radio_state_to_string(radio->state));
ril_cell_info_refresh(self);
if (self->radio->state != RADIO_STATE_ON) {
ril_cell_info_update_cells(self, NULL);
}
}
static void ril_cell_info_sim_status_cb(struct ril_sim_card *sim, void *arg)
......@@ -410,7 +377,6 @@ static void ril_cell_info_sim_status_cb(struct ril_sim_card *sim, void *arg)
self->sim_card_ready = ril_sim_card_ready(sim);
DBG_(self, "%sready", self->sim_card_ready ? "" : "not ");
ril_cell_info_refresh(self);
ril_cell_info_update_rate(self);
}
......@@ -512,7 +478,6 @@ struct sailfish_cell_info *ril_cell_info_new(GRilIoChannel *io,
ril_sim_card_add_status_changed_handler(self->sim_card,
ril_cell_info_sim_status_cb, self);
self->sim_card_ready = ril_sim_card_ready(sim_card);
ril_cell_info_refresh(self);
ril_cell_info_update_rate(self);
return &self->info;
}
......@@ -526,10 +491,6 @@ static void ril_cell_info_dispose(GObject *object)
struct ril_cell_info *self = RIL_CELL_INFO(object);
grilio_channel_remove_handlers(self->io, &self->event_id, 1);
if (self->query_id) {
grilio_channel_cancel_request(self->io, self->query_id, FALSE);
self->query_id = 0;
}
if (self->set_rate_id) {
grilio_channel_cancel_request(self->io, self->set_rate_id,
FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment