network: Don't show modems supported by cellular panel

Cellular panel is already handling it
This commit is contained in:
Mohammed Sadiq 2019-10-04 16:02:23 +05:30 committed by Georges Basile Stavracas Neto
parent dc840f0aec
commit 169f537e4b

View file

@ -382,6 +382,27 @@ update_bluetooth_section (CcNetworkPanel *self)
gtk_widget_set_visible (self->container_bluetooth, self->bluetooth_devices->len > 0);
}
static gboolean
wwan_panel_supports_modem (GDBusObject *object)
{
MMObject *mm_object;
MMModem *modem;
MMModemCapability capability, supported_capabilities;
g_assert (G_IS_DBUS_OBJECT (object));
supported_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_LTE;
#if MM_CHECK_VERSION (1,14,0)
supported_capabilities |= MM_MODEM_CAPABILITY_5GNR;
#endif
mm_object = MM_OBJECT (object);
modem = mm_object_get_modem (mm_object);
capability = mm_modem_get_current_capabilities (modem);
return capability & supported_capabilities;
}
static void
panel_add_device (CcNetworkPanel *self, NMDevice *device)
{
@ -425,6 +446,10 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
nm_device_get_udi (device));
return;
}
/* This will be handled by cellular panel */
if (wwan_panel_supports_modem (modem_object))
return;
}
device_mobile = net_device_mobile_new (self->client, device, modem_object);