MBIM: Should not update SIM infos triggered by slot switch during modem shutdown
When switching slot, ModemManager will update SIM slot infos before modem shutdown.
"slot-info-status indication received reporting that the new slot is active happens while the modem is being disabled, and that triggers the update of the SimSlots property, which may not be what we want as the modem object is being shutdown"
Aleksander suggest use pending_sim_slot_switch_action flag to cleanly ignore SIM related indications and update basic_connect_notification_subscriber_ready_status to exit early.
2022-10-12T06:49:03.020732Z DEBUG shill[1383]: VERBOSE2 shill: [mm1_modem_proxy.cc(156)] /org/freedesktop/ModemManager1/Modem/1 SetPrimarySimSlot: 1
2022-10-12T06:49:03.023007Z DEBUG ModemManager[2140]: <debug> [modem1] user request to disconnect modem (all bearers)
2022-10-12T06:49:03.070776Z DEBUG ModemManager[2140]: <debug> [/dev/cdc-wdm0] sent message (translated)...#012<<<<<< Header:#012<<<<<< length = 64#012<<<<<< type = command (0x00000003)#012<<<<<< transaction = 67#012<<<<<< Fragment header:#012<<<<<< total = 1#012<<<<<< current = 0#012<<<<<< Contents:#012<<<<<< service = 'ms-basic-connect-extensions' (3d01dcc5-fef5-4d05-0d3a-bef7058e9aaf)#012<<<<<< cid = 'device-slot-mappings' (0x00000007)#012<<<<<< type = 'set' (0x00000001)#012<<<<<< Fields:#012<<<<<< MapCount = '1'#012<<<<<< SlotMap = '{#012<<<<<< [0] = {#012<<<<<< Slot = '0'#012<<<<<< },#012<<<<<< }'#012
2022-10-12T06:49:03.197819Z DEBUG ModemManager[2140]: <debug> [/dev/cdc-wdm0] received message (translated)...#012>>>>>> Header:#012>>>>>> length = 64#012>>>>>> type = command-done (0x80000003)#012>>>>>> transaction = 67#012>>>>>> Fragment header:#012>>>>>> total = 1#012>>>>>> current = 0#012>>>>>> Contents:#012>>>>>> status error = 'None' (0x00000000)#012>>>>>> service = 'ms-basic-connect-extensions' (3d01dcc5-fef5-4d05-0d3a-bef7058e9aaf)#012>>>>>> cid = 'device-slot-mappings' (0x00000007)#012>>>>>> Fields:#012>>>>>> MapCount = '1'#012>>>>>> SlotMap = '{#012>>>>>> [0] = {#012>>>>>> Slot = '0'#012>>>>>> },#012>>>>>> }'#012
......
2022-10-12T06:49:03.229364Z DEBUG ModemManager[2140]: <debug> [/dev/cdc-wdm0] received message (translated)...#012>>>>>> Header:#012>>>>>> length = 52#012>>>>>> type = indicate-status (0x80000007)#012>>>>>> transaction = 0#012>>>>>> Fragment header:#012>>>>>> total = 1#012>>>>>> current = 0#012>>>>>> Contents:#012>>>>>> service = 'ms-basic-connect-extensions' (3d01dcc5-fef5-4d05-0d3a-bef7058e9aaf)#012>>>>>> cid = 'slot-info-status' (0x00000008)#012>>>>>> Fields:#012>>>>>> SlotIndex = '1'#012>>>>>> State = 'state-active'#012
2022-10-12T06:49:03.229470Z DEBUG ModemManager[2140]: <debug> [modem1] received notification (service 'ms-basic-connect-extensions', command 'slot-info-status')
2022-10-12T06:49:03.229504Z DEBUG ModemManager[2140]: <debug> [modem1] processing slot status change in non-active SIM slot 2: state-active
2022-10-12T06:49:03.229526Z DEBUG ModemManager[2140]: <debug> [modem1] found inactive SIM in slot 1: physical (n/a)
......
2022-10-12T06:49:03.488035Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'usbmisc/cdc-wdm0'...
2022-10-12T06:49:03.488114Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'unknown/ttyUSB0'...
2022-10-12T06:49:03.488135Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'unknown/ttyUSB2'...
2022-10-12T06:49:03.488155Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'net/wwan0'...
2022-10-12T06:49:03.488187Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'unknown/ttyUSB1'...
2022-10-12T06:49:03.488208Z DEBUG ModemManager[2140]: <debug> [modem1] cleaning up port 'unknown/ttyUSB3'...
2022-10-12T06:49:03.488432Z DEBUG ModemManager[2140]: <debug> [modem1] completely disposed