diff options
-rw-r--r-- | src/network.c | 12 | ||||
-rw-r--r-- | src/sim.c | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/network.c b/src/network.c index 8135fd21..33a1f65a 100644 --- a/src/network.c +++ b/src/network.c @@ -1202,8 +1202,12 @@ static void sim_opl_read_cb(struct ofono_modem *modem, int ok, int total; GSList *l; - if (!ok) + if (!ok) { + if (record > 0) + goto optimize; + return; + } if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED) return; @@ -1218,6 +1222,7 @@ static void sim_opl_read_cb(struct ofono_modem *modem, int ok, if (record != total) return; +optimize: sim_eons_optimize(netreg->eons); for (l = netreg->operator_list; l; l = l->next) { @@ -1241,7 +1246,7 @@ static void sim_pnn_read_cb(struct ofono_modem *modem, int ok, int total; if (!ok) - return; + goto check; if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED) return; @@ -1256,11 +1261,12 @@ static void sim_pnn_read_cb(struct ofono_modem *modem, int ok, sim_eons_add_pnn_record(netreg->eons, record, data, record_length); +check: /* If PNN is not present then OPL is not useful, don't * retrieve it. If OPL is not there then PNN[1] will * still be used for the HPLMN and/or EHPLMN, if PNN * is present. */ - if (record == total && !sim_eons_pnn_is_empty(netreg->eons)) + if ((record == total || !ok) && !sim_eons_pnn_is_empty(netreg->eons)) ofono_sim_read(modem, SIM_EFOPL_FILEID, sim_opl_read_cb, NULL); } @@ -182,7 +182,7 @@ static void sim_msisdn_read_cb(struct ofono_modem *modem, int ok, struct ofono_phone_number *ph; if (!ok) - return; + goto check; if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED) return; @@ -202,7 +202,7 @@ static void sim_msisdn_read_cb(struct ofono_modem *modem, int ok, sim->own_numbers = g_slist_prepend(sim->own_numbers, ph); check: - if (record == total && sim->own_numbers) { + if ((record == total || !ok) && sim->own_numbers) { char **own_numbers; DBusConnection *conn = ofono_dbus_get_connection(); |