>>       if (g_str_equal(key, "SubscriberIdentity")) {
>> -             sim_update_imsi(modem, &value);
>> +             dbus_message_iter_get_basic(&value, &new_imsi);
>> +
>> +             if (g_strcmp0(modem->imsi,new_imsi) != 0) {
>What is the benefit of checking the existing imsi against the new one?
>Isn't it known already that the sim is tied to this particular modem, as
>the modem is looked using the sending D-Bus path?

>> +                     sim_update_imsi(modem, &value);
>> +
>> +                     if (modem->device)
>> +                             destroy_device(modem);
>> +             }
>Shouldn't this then be run unconditionally?

For some reason (didn't dig it further) the sim_changed is called multiple 
times with the SubscriberIdentity as key when hot-swapping the sim card and the 
connman already has the new IMSI so we should not destroy the device in that 
case to get service identier corrected as it is already correct. It can lead to 
connman missing the cellular context if it's done (yes, I tried.. and it seems 
to occur when the sim has a pin set but not when it does not).

>BTW, the sim_* functions are in need of better checking that the
>messages contain the desired properties.

Noticed that also when discussing with Hannu Mallat. :)
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to