From: Caiwen Zhang Date: Fri, 7 Mar 2014 14:37:56 +0000 (+0800) Subject: he910: Fixup SIM status switching X-Git-Tag: accepted/tizen/generic/20140310.074052^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_3.0.2014.q3_common;p=platform%2Fupstream%2Fofono.git he910: Fixup SIM status switching SIM inserted notification may be missed, when get SIM status is ready, make sure SIM inserted is set. Change-Id: Iad752d39af544c2f177015b5e2530018e8947d40 --- diff --git a/plugins/he910.c b/plugins/he910.c index 10adf3c..ab4a74b 100644 --- a/plugins/he910.c +++ b/plugins/he910.c @@ -130,19 +130,19 @@ static void switch_sim_state_status(struct ofono_modem *modem, int status) data->sms_phonebook_added = FALSE; } break; - case 1: /* SIM inserted */ - case 2: /* SIM inserted and PIN unlocked */ - if (data->have_sim == FALSE) { - ofono_sim_inserted_notify(data->sim, TRUE); - data->have_sim = TRUE; - } - break; case 3: /* SIM inserted, SMS and phonebook ready */ if (data->sms_phonebook_added == FALSE) { ofono_phonebook_create(modem, 0, "atmodem", data->chat); ofono_sms_create(modem, 0, "atmodem", data->chat); data->sms_phonebook_added = TRUE; } + /* Go down to case 1 and 2, in case of they are missed */ + case 1: /* SIM inserted */ + case 2: /* SIM inserted and PIN unlocked */ + if (data->have_sim == FALSE) { + ofono_sim_inserted_notify(data->sim, TRUE); + data->have_sim = TRUE; + } break; default: ofono_warn("Unknown SIM state %d received", status);