summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sim.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sim.c b/src/sim.c
index 58b4fee6..c39269df 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -624,7 +624,7 @@ static void sim_unlock_cb(const struct ofono_error *error, void *data)
DBusMessage *reply = __ofono_error_failed(sim->pending);
__ofono_dbus_pending_reply(&sim->pending, reply);
- sim_pin_retries_check(sim);
+ sim_pin_check(sim);
return;
}
@@ -640,7 +640,7 @@ static void sim_lock_cb(const struct ofono_error *error, void *data)
DBusMessage *reply = __ofono_error_failed(sim->pending);
__ofono_dbus_pending_reply(&sim->pending, reply);
- sim_pin_retries_check(sim);
+ sim_pin_check(sim);
return;
}
@@ -711,7 +711,7 @@ static void sim_change_pin_cb(const struct ofono_error *error, void *data)
__ofono_dbus_pending_reply(&sim->pending,
__ofono_error_failed(sim->pending));
- sim_pin_retries_check(sim);
+ sim_pin_check(sim);
return;
}
@@ -2231,6 +2231,15 @@ static void sim_pin_query_cb(const struct ofono_error *error,
&pin_name);
}
+ if (pin_type != OFONO_SIM_PASSWORD_NONE &&
+ sim->state == OFONO_SIM_STATE_READY) {
+ /* 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_pin_retries_check(sim);
checkdone: