Commit 9b9b872e authored by Slava Monich's avatar Slava Monich

[ofono] Remove cellular service when network goes away

Otherwise services keep piling up when SIM cards are changing. Also,
they waste certain amount of space in the permanant storage and we
provide no way to the user to remove those.
parent 4ec90c8e
......@@ -419,12 +419,23 @@ static void modem_create_network(struct modem_data *md)
static void modem_destroy_network(struct modem_data *md)
{
if (md->network) {
struct connman_service *service =
connman_service_lookup_from_network(md->network);
if (service) {
connman_service_ref(service);
}
DBG("%s", ofono_modem_path(md->modem));
connman_device_remove_network(md->device, md->network);
if (md->network) {
connman_network_unref(md->network);
md->network = NULL;
}
if (service) {
__connman_service_remove(service);
connman_service_unref(service);
}
}
}
......
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