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.
This commit is contained in:
Marcel Holtmann 2011-07-27 23:54:37 +02:00
parent c9632f9817
commit a159a0f9fc
1 changed files with 9 additions and 0 deletions

View File

@ -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;