Hi Andrew,

> ---
> +static void sim_ready_watch(void *user)
> +{
> +     struct ofono_voicecall *vc = user;
> +     struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
> +     struct ofono_atom *sim_atom =
> +             __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM);
> +     struct ofono_sim *sim = __ofono_atom_get_data(sim_atom);
> +
> +     /* Try both formats, only one or none will work */
> +     ofono_sim_read(sim, SIM_EFECC_FILEID,
> +                     OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
> +                     ecc_g2_read_cb, vc);
> +     ofono_sim_read(sim, SIM_EFECC_FILEID,
> +                     OFONO_SIM_FILE_STRUCTURE_FIXED,
> +                     ecc_g3_read_cb, vc);
> +}

This part needs to be done when SIM is inserted.  If you refactor the previous 
patch, then we should also easily have INSERTED state notifications too and get 
this taken care of properly.

> +
> +static void sim_removed_watch(void *user)
> +{
> +     struct ofono_voicecall *vc = user;
> +
> +     vc->flags |= VOICECALLS_FLAG_MULTI_RELEASE;
> +
> +     /* TODO: Don't hang up emergency calls */
> +     voicecalls_release_queue(vc, vc->call_list);
> +     voicecalls_release_next(vc);

I suggest you only shuffle the emergency numbers here.  Let the modem driver 
notify which calls have been terminated.  If this is wrong we can fix it later, 
but sending a CHLD=1X is actually wrong here.

Regards,
-Denis
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to