From 4677729502fa2dfb7da1d90e1183df71a51066c2 Mon Sep 17 00:00:00 2001 From: Tommi Kenakkala Date: Thu, 18 Jun 2015 14:46:57 +0300 Subject: sim: Reset pin_type on card remove Fixes PinRequired not being emitted when a card is inserted --- src/sim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sim.c b/src/sim.c index b5badf17..715f3c05 100644 --- a/src/sim.c +++ b/src/sim.c @@ -2485,10 +2485,13 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted) sim_inserted_update(sim); call_state_watches(sim); - if (inserted) + if (inserted) { sim_initialize(sim); - else + } else { + sim->pin_type = OFONO_SIM_PASSWORD_NONE; + sim_free_state(sim); + } } unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim, -- cgit v1.2.3