diff options
author | Denis Kenzior <denkenz@gmail.com> | 2011-02-17 14:20:04 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-17 15:09:16 -0600 |
commit | ad181b690bd580b6f2694a5b4f28a10c724131bd (patch) | |
tree | 2f7461c03ba37f3272c87856b851ec6bc264e6ae /src/modem.c | |
parent | 131d86a2f910885a700d150a19049c5cc0699738 (diff) | |
download | ofono-ad181b690bd580b6f2694a5b4f28a10c724131bd.tar.bz2 |
sim: Tweak the behavior of sim_refresh slightly
Instead of notifying everyone of sim_inserted condition, we should
simply notify the modem directly. It is the only one interested in this
particular change.
This partly reverts an earlier commit:
9498ad6b5633e350eb529f8efbe08270d95c8003
Diffstat (limited to 'src/modem.c')
-rw-r--r-- | src/modem.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/modem.c b/src/modem.c index 3dd44ad1..26468e8a 100644 --- a/src/modem.c +++ b/src/modem.c @@ -598,13 +598,8 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user) switch (new_state) { case OFONO_SIM_STATE_NOT_PRESENT: + modem_change_state(modem, MODEM_STATE_PRE_SIM); case OFONO_SIM_STATE_INSERTED: - if (modem->modem_state != MODEM_STATE_PRE_SIM) { - if (modem->modem_state == MODEM_STATE_ONLINE) - modem->get_online = TRUE; - - modem_change_state(modem, MODEM_STATE_PRE_SIM); - } break; case OFONO_SIM_STATE_READY: modem_change_state(modem, MODEM_STATE_OFFLINE); @@ -1970,6 +1965,16 @@ void ofono_modem_reset(struct ofono_modem *modem) modem_change_state(modem, MODEM_STATE_PRE_SIM); } +void __ofono_modem_sim_reset(struct ofono_modem *modem) +{ + DBG("%p", modem); + + if (modem->modem_state == MODEM_STATE_ONLINE) + modem->get_online = TRUE; + + modem_change_state(modem, MODEM_STATE_PRE_SIM); +} + int ofono_modem_driver_register(const struct ofono_modem_driver *d) { DBG("driver: %p, name: %s", d, d->name); |