diff options
Diffstat (limited to 'samsung-ril.c')
-rw-r--r-- | samsung-ril.c | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/samsung-ril.c b/samsung-ril.c index 31d0244..6378c23 100644 --- a/samsung-ril.c +++ b/samsung-ril.c @@ -1197,20 +1197,36 @@ int ril_radio_state_update(RIL_RadioState radio_state) } /* + * RIL SIM state + */ + +int ril_sim_state_update(enum sim_state sim_state) +{ + if (ril_data == NULL) + return -1; + + if (ril_data->sim_state == sim_state) + return 0; + + RIL_LOGD("Updating RIL SIM state to %d", sim_state); + + ril_data->sim_state = sim_state; + + ril_request_unsolicited(RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, NULL, 0); + + return 0; +} + +/* * Returns 0 if the RIL has reached the given radio_state * Returns -1 otherwise */ int ril_radio_has_reached_state(RIL_RadioState given_state) { RIL_RadioState radio_states[] = { - RADIO_STATE_UNAVAILABLE, RADIO_STATE_OFF, + RADIO_STATE_UNAVAILABLE, RADIO_STATE_ON, - RADIO_STATE_NV_NOT_READY, - RADIO_STATE_NV_READY, - RADIO_STATE_SIM_NOT_READY, - RADIO_STATE_SIM_LOCKED_OR_ABSENT, - RADIO_STATE_SIM_READY, }; RIL_RadioState curr_state; @@ -1243,6 +1259,25 @@ int ril_radio_has_reached_state(RIL_RadioState given_state) } /* + * Returns 0 if the RIL has reached the given sim_state + * Returns -1 otherwise + */ +int ril_sim_has_reached_state(enum sim_state given_state) +{ + enum sim_state curr_state; + + if (ril_data == NULL) + return -1; + + curr_state = ril_data->sim_state; + + if (curr_state < given_state) + return -1; + + return 0; +} + +/* * RIL data */ |