diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-07-08 12:41:11 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-07-08 12:41:11 +0200 |
commit | aaa28f88ef0bb20bfbcfdf1260bd3fd0faff98c6 (patch) | |
tree | 8f73975a7031e2b4a21b96ccbbf33eae7d9b2e0b | |
parent | 6701ae6fece2ec8f8597ea837d890fdbfe82aadc (diff) | |
download | network-manager-applet-jk/no-auto-unlock-sim-rh918692.tar.gz |
applet: introduce --no-auto-unlock-sim" option (rh #918692)jk/no-auto-unlock-sim-rh918692
It disables auto-unlocking SIM feature.
https://bugzilla.redhat.com/show_bug.cgi?id=918692
-rw-r--r-- | src/applet-device-broadband.c | 6 | ||||
-rw-r--r-- | src/main.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/applet-device-broadband.c b/src/applet-device-broadband.c index 66ae9a5e..79a518cf 100644 --- a/src/applet-device-broadband.c +++ b/src/applet-device-broadband.c @@ -35,6 +35,8 @@ #include "mobile-helpers.h" #include "mb-menu-item.h" +extern gboolean auto_unlock_sim; + typedef struct { NMApplet *applet; NMDevice *device; @@ -435,6 +437,10 @@ modem_get_sim_ready (MMModem *modem, if (mm_modem_get_state (info->mm_modem) != MM_MODEM_STATE_LOCKED) return; + /* Do nothing if auto-unlocking feature is disabled */ + if (!auto_unlock_sim) + return; + /* If we have a device ID ask the keyring for any saved SIM-PIN codes */ if (mm_modem_get_device_identifier (info->mm_modem) && mm_modem_get_unlock_required (info->mm_modem) == MM_MODEM_LOCK_SIM_PIN) { @@ -39,6 +39,7 @@ static GMainLoop *loop = NULL; gboolean shell_debug = FALSE; gboolean with_agent = TRUE; +gboolean auto_unlock_sim = TRUE; static void usage (const char *progname) @@ -68,6 +69,8 @@ int main (int argc, char *argv[]) shell_debug = TRUE; if (!strcmp (argv[i], "--no-agent")) with_agent = FALSE; + if (!strcmp (argv[i], "--no-auto-unlock-sim")) + auto_unlock_sim = FALSE; } bindtextdomain (GETTEXT_PACKAGE, NMALOCALEDIR); |