From 661ea845d05f879c6b2ada2fcca5928efd81201d Mon Sep 17 00:00:00 2001 From: Caiwen Zhang Date: Fri, 7 Mar 2014 22:37:56 +0800 Subject: [PATCH] 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 --- plugins/he910.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/he910.c b/plugins/he910.c index 69362b8..d7f8df1 100644 --- a/plugins/he910.c +++ b/plugins/he910.c @@ -131,19 +131,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); -- 2.7.4