Don't remove atoms when state goes from INSERTED to NOT PRESENT.
PATCH v2 1/6 Don't remove atoms when state goes from INSERTED to NOT PRESENT.
--- src/modem.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
src/modem.c +6 -3
@@ -1132,13 +1132,16 @@ static void modem_sim_ready(void *user, enum ofono_sim_state new_state)switch (new_state) {case OFONO_SIM_STATE_NOT_PRESENT : -remove_all_atoms (&modem->atoms); +if (modem->pre_sim_atoms !=NULL ) +remove_all_atoms (&modem->atoms);break ;case OFONO_SIM_STATE_INSERTED :break ;case OFONO_SIM_STATE_READY : - modem->pre_sim_atoms = modem->atoms; - modem->atoms =NULL ; +if (modem->pre_sim_atoms ==NULL ) { + modem->pre_sim_atoms = modem->atoms; + modem->atoms =NULL ; + }if (modem->driver->post_sim) modem->driver->post_sim (modem);
Signature · 1 line
1.6.1
Hi Andrew,
src/modem.c
Quoted 6 lines
--- src/modem.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)src/modem.c +0
-0
Patch has been applied with a modified description. However, I'm thinking we should manipulate the lists directly based on SIM presence / pin state inside ofono_modem_add_atom. The logic is a little too complicated now.
Regards,
-Denis