summaryrefslogtreecommitdiffstats
path: root/src/network.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-07-27 23:54:37 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-07-27 23:54:37 +0200
commita159a0f9fcc648f09a0da48577933c91cae50a5d (patch)
treeb8467a862ab1ef0492817d418296f7e58208db03 /src/network.c
parentc9632f9817714b58f4ea842acd34b6351ede1446 (diff)
downloadofono-a159a0f9fcc648f09a0da48577933c91cae50a5d.tar.bz2
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.
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c9
1 files changed, 9 insertions, 0 deletions
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;