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);
case OFONO_SIM_STATE_INSERTED:
break;
case OFONO_SIM_STATE_LOCKED_OUT:
modem_change_state(modem, MODEM_STATE_PRE_SIM);
break;
case OFONO_SIM_STATE_READY:
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)
return;
if (sim->state != OFONO_SIM_STATE_INSERTED)
if (sim->state != OFONO_SIM_STATE_INSERTED &&
sim->state != OFONO_SIM_STATE_LOCKED_OUT)
return;
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 */
sim_free_main_state(sim);
sim->state = OFONO_SIM_STATE_INSERTED;
__ofono_modem_sim_reset(
__ofono_atom_get_modem(sim->atom));
sim->state = OFONO_SIM_STATE_LOCKED_OUT;
call_state_watches(sim);
}
break;
}