From a159a0f9fcc648f09a0da48577933c91cae50a5d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Jul 2011 23:54:37 +0200 Subject: network: Force auto-only mode if manual registration is not supported If the network registration driver decides to not provide a manual registration method, then force the mode to auto-only. --- src/network.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/network.c b/src/network.c index d765e29a..897e1fef 100644 --- a/src/network.c +++ b/src/network.c @@ -1483,6 +1483,12 @@ static void init_registration_status(const struct ofono_error *error, netreg); } + if (netreg->driver->register_manual == NULL) { + set_registration_mode(netreg, + NETWORK_REGISTRATION_MODE_AUTO_ONLY); + return; + } + if (netreg->sim_context) { ofono_sim_read(netreg->sim_context, SIM_EF_CPHS_CSP_FILEID, OFONO_SIM_FILE_STRUCTURE_TRANSPARENT, @@ -1924,6 +1930,9 @@ static void netreg_load_settings(struct ofono_netreg *netreg) char *strmode; gboolean upgrade = FALSE; + if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY) + return; + imsi = ofono_sim_get_imsi(netreg->sim); if (imsi == NULL) return; -- cgit v1.2.3