he910: Fixup SIM status switching 84/17584/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_ivi_panda accepted/tizen_ivi_release tizen_3.0.2014.q3_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi tizen_ivi_panda tizen_ivi_release accepted/tizen/generic/20140310.074052 accepted/tizen/ivi/20140310.173440 accepted/tizen/ivi/20140604.130219 accepted/tizen/ivi/panda/20140403.014243 accepted/tizen/ivi/release/20140315.035842 accepted/tizen/mobile/20140310.030652 submit/accepted/tizen_generic/20140307.170209 submit/tizen/20140310.133042 submit/tizen/20140523.185812 submit/tizen_ivi_panda/20140403.012045 submit/tizen_ivi_release/20140315.035338 submit/tizen_ivi_release/20140315.035602 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release
authorCaiwen Zhang <caiwen.zhang@intel.com>
Fri, 7 Mar 2014 14:37:56 +0000 (22:37 +0800)
committerCaiwen Zhang <caiwen.zhang@intel.com>
Fri, 7 Mar 2014 14:47:43 +0000 (22:47 +0800)
SIM inserted notification may be missed, when get SIM status is ready,
make sure SIM inserted is set.

Change-Id: Iad752d39af544c2f177015b5e2530018e8947d40

plugins/he910.c

index 10adf3c..ab4a74b 100644 (file)
@@ -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);