sim: Support SIM_STATE_LOCKED_OUT

This commit is contained in:
Denis Kenzior 2011-07-19 14:09:27 -05:00
parent 7abc4f0a1a
commit c6c01110ec
2 changed files with 7 additions and 4 deletions

View File

@ -678,6 +678,9 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
modem_change_state(modem, MODEM_STATE_PRE_SIM); modem_change_state(modem, MODEM_STATE_PRE_SIM);
case OFONO_SIM_STATE_INSERTED: case OFONO_SIM_STATE_INSERTED:
break; break;
case OFONO_SIM_STATE_LOCKED_OUT:
modem_change_state(modem, MODEM_STATE_PRE_SIM);
break;
case OFONO_SIM_STATE_READY: case OFONO_SIM_STATE_READY:
modem_change_state(modem, MODEM_STATE_OFFLINE); modem_change_state(modem, MODEM_STATE_OFFLINE);

View File

@ -1374,7 +1374,8 @@ static void sim_set_ready(struct ofono_sim *sim)
if (sim == NULL) if (sim == NULL)
return; return;
if (sim->state != OFONO_SIM_STATE_INSERTED) if (sim->state != OFONO_SIM_STATE_INSERTED &&
sim->state != OFONO_SIM_STATE_LOCKED_OUT)
return; return;
sim->state = OFONO_SIM_STATE_READY; sim->state = OFONO_SIM_STATE_READY;
@ -2385,9 +2386,8 @@ static void sim_pin_query_cb(const struct ofono_error *error,
/* Force the sim state out of READY */ /* Force the sim state out of READY */
sim_free_main_state(sim); sim_free_main_state(sim);
sim->state = OFONO_SIM_STATE_INSERTED; sim->state = OFONO_SIM_STATE_LOCKED_OUT;
__ofono_modem_sim_reset( call_state_watches(sim);
__ofono_atom_get_modem(sim->atom));
} }
break; break;
} }