broadband-modem-mbim: update sim-type and esim-status of inactive slot
During initialization if the number of slots is more than 1 then update the sim-type and esim-status of the inactive slot as well.
This commit is contained in:
@@ -5149,6 +5149,8 @@ update_sim_from_slot_status (MMBroadbandModemMbim *self,
|
||||
guint slot_index)
|
||||
{
|
||||
g_autoptr(MMBaseSim) sim = NULL;
|
||||
MMSimType sim_type = MM_SIM_TYPE_UNKNOWN;
|
||||
MMSimEsimStatus esim_status = MM_SIM_ESIM_STATUS_UNKNOWN;
|
||||
|
||||
mm_obj_dbg (self, "Updating sim at slot %d", slot_index + 1);
|
||||
|
||||
@@ -5159,9 +5161,21 @@ update_sim_from_slot_status (MMBroadbandModemMbim *self,
|
||||
slot_status == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM_NO_PROFILES ||
|
||||
slot_status == MBIM_UICC_SLOT_STATE_NOT_READY ||
|
||||
slot_status == MBIM_UICC_SLOT_STATE_ERROR) {
|
||||
|
||||
if (slot_status == MBIM_UICC_SLOT_STATE_ACTIVE)
|
||||
sim_type = MM_SIM_TYPE_PHYSICAL;
|
||||
else if (slot_status == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM) {
|
||||
sim_type = MM_SIM_TYPE_ESIM;
|
||||
esim_status = MM_SIM_ESIM_STATUS_WITH_PROFILES;
|
||||
} else if (slot_status == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM_NO_PROFILES) {
|
||||
sim_type = MM_SIM_TYPE_ESIM;
|
||||
esim_status = MM_SIM_ESIM_STATUS_NO_PROFILES;
|
||||
}
|
||||
sim = mm_sim_mbim_new_initialized (MM_BASE_MODEM (self),
|
||||
slot_index,
|
||||
FALSE,
|
||||
sim_type,
|
||||
esim_status,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -8365,6 +8379,8 @@ query_slot_information_status_ready (MbimDevice *device,
|
||||
LoadSimSlotsContext *ctx;
|
||||
MMBaseSim *sim;
|
||||
gboolean sim_active = FALSE;
|
||||
MMSimType sim_type = MM_SIM_TYPE_UNKNOWN;
|
||||
MMSimEsimStatus esim_status = MM_SIM_ESIM_STATUS_UNKNOWN;
|
||||
|
||||
self = g_task_get_source_object (task);
|
||||
ctx = g_task_get_task_data (task);
|
||||
@@ -8393,9 +8409,22 @@ query_slot_information_status_ready (MbimDevice *device,
|
||||
slot_state == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM_NO_PROFILES ||
|
||||
slot_state == MBIM_UICC_SLOT_STATE_NOT_READY ||
|
||||
slot_state == MBIM_UICC_SLOT_STATE_ERROR) {
|
||||
|
||||
if (slot_state == MBIM_UICC_SLOT_STATE_ACTIVE)
|
||||
sim_type = MM_SIM_TYPE_PHYSICAL;
|
||||
else if (slot_state == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM) {
|
||||
sim_type = MM_SIM_TYPE_ESIM;
|
||||
esim_status = MM_SIM_ESIM_STATUS_WITH_PROFILES;
|
||||
} else if (slot_state == MBIM_UICC_SLOT_STATE_ACTIVE_ESIM_NO_PROFILES) {
|
||||
sim_type = MM_SIM_TYPE_ESIM;
|
||||
esim_status = MM_SIM_ESIM_STATUS_NO_PROFILES;
|
||||
}
|
||||
|
||||
sim = mm_sim_mbim_new_initialized (MM_BASE_MODEM (self),
|
||||
slot_index,
|
||||
sim_active,
|
||||
sim_type,
|
||||
esim_status,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@@ -1188,6 +1188,8 @@ MMBaseSim *
|
||||
mm_sim_mbim_new_initialized (MMBaseModem *modem,
|
||||
guint slot_number,
|
||||
gboolean active,
|
||||
MMSimType sim_type,
|
||||
MMSimEsimStatus esim_status,
|
||||
const gchar *sim_identifier,
|
||||
const gchar *imsi,
|
||||
const gchar *eid,
|
||||
@@ -1201,6 +1203,8 @@ mm_sim_mbim_new_initialized (MMBaseModem *modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_SLOT_NUMBER, slot_number,
|
||||
"active", active,
|
||||
"sim-type", sim_type,
|
||||
"esim-status", esim_status,
|
||||
"sim-identifier", sim_identifier,
|
||||
"eid", eid,
|
||||
"operator-identifier", operator_identifier,
|
||||
|
@@ -53,6 +53,8 @@ MMBaseSim *mm_sim_mbim_new_finish (GAsyncResult *res,
|
||||
MMBaseSim *mm_sim_mbim_new_initialized (MMBaseModem *modem,
|
||||
guint slot_number,
|
||||
gboolean active,
|
||||
MMSimType sim_type,
|
||||
MMSimEsimStatus esim_status,
|
||||
const gchar *sim_identifier,
|
||||
const gchar *imsi,
|
||||
const gchar *eid,
|
||||
|
Reference in New Issue
Block a user