Blame SOURCES/0001-status-network-Use-wwan-settings-panel-for-GSM-LTE-M.patch

1bd53d
From 7e94d682985ac4ff422da73b5878f4f005eff67b Mon Sep 17 00:00:00 2001
1bd53d
From: Mohammed Sadiq <sadiq@sadiqpk.org>
1bd53d
Date: Tue, 10 Aug 2021 15:22:30 +0530
1bd53d
Subject: [PATCH] status/network: Use wwan settings panel for GSM/LTE Modems
1bd53d
1bd53d
GSM/UMTS/LTE modems now have better support with wwan panel in GNOME
1bd53d
Settings.  So, if the modem supports, open wwan panel, otherwise
1bd53d
fallback to opening network panel when "Mobile Broadband Settings"
1bd53d
item is clicked.
1bd53d
1bd53d
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/583
1bd53d
1bd53d
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1942>
1bd53d
---
1bd53d
 js/ui/status/network.js | 19 +++++++++++++++++--
1bd53d
 1 file changed, 17 insertions(+), 2 deletions(-)
1bd53d
1bd53d
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
1bd53d
index f510f90ae..fe82fcb08 100644
1bd53d
--- a/js/ui/status/network.js
1bd53d
+++ b/js/ui/status/network.js
1bd53d
@@ -543,7 +543,11 @@ var NMDeviceModem = class extends NMConnectionDevice {
1bd53d
     constructor(client, device) {
1bd53d
         super(client, device);
1bd53d
 
1bd53d
-        this.item.menu.addSettingsAction(_("Mobile Broadband Settings"), 'gnome-network-panel.desktop');
1bd53d
+        const settingsPanel = this._useWwanPanel()
1bd53d
+            ? 'gnome-wwan-panel.desktop'
1bd53d
+            : 'gnome-network-panel.desktop';
1bd53d
+
1bd53d
+        this.item.menu.addSettingsAction(_('Mobile Broadband Settings'), settingsPanel);
1bd53d
 
1bd53d
         this._mobileDevice = null;
1bd53d
 
1bd53d
@@ -573,8 +577,19 @@ var NMDeviceModem = class extends NMConnectionDevice {
1bd53d
         return NMConnectionCategory.WWAN;
1bd53d
     }
1bd53d
 
1bd53d
+    _useWwanPanel() {
1bd53d
+        // Currently, wwan panel doesn't support CDMA_EVDO modems
1bd53d
+        const supportedCaps =
1bd53d
+            NM.DeviceModemCapabilities.GSM_UMTS |
1bd53d
+            NM.DeviceModemCapabilities.LTE;
1bd53d
+        return this._device.current_capabilities & supportedCaps;
1bd53d
+    }
1bd53d
+
1bd53d
     _autoConnect() {
1bd53d
-        launchSettingsPanel('network', 'connect-3g', this._device.get_path());
1bd53d
+        if (this._useWwanPanel())
1bd53d
+            launchSettingsPanel('wwan', 'show-device', this._device.udi);
1bd53d
+        else
1bd53d
+            launchSettingsPanel('network', 'connect-3g', this._device.get_path());
1bd53d
     }
1bd53d
 
1bd53d
     _sessionUpdated() {
1bd53d
-- 
1bd53d
2.31.1
1bd53d