radio-settings: Init pending_band_{gsm|umts}

The set_band method takes two parameters for band settings, one for gsm
and one for umts.  When loaded from storage, and they are not set to
defaults, the band variables can get out of sync when setting the
GsmBand and UmtsBand properties.
This commit is contained in:
Antara Borwankar 2016-04-28 04:30:49 +05:30 committed by Denis Kenzior
parent 29ff4dc2e4
commit d8b60d854c
1 changed files with 6 additions and 4 deletions

View File

@ -855,6 +855,8 @@ static void radio_load_settings(struct ofono_radio_settings *rs,
"GsmBand", rs->band_gsm);
}
rs->pending_band_gsm = rs->band_gsm;
error = NULL;
rs->band_umts = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
"UmtsBand", &error);
@ -865,6 +867,8 @@ static void radio_load_settings(struct ofono_radio_settings *rs,
"UmtsBand", rs->band_umts);
}
rs->pending_band_umts = rs->band_umts;
error = NULL;
rs->mode = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
"TechnologyPreference", &error);
@ -890,10 +894,8 @@ void ofono_radio_settings_register(struct ofono_radio_settings *rs)
radio_load_settings(rs, ofono_sim_get_imsi(sim));
if (rs->driver->set_band == NULL)
goto finish;
rs->driver->set_band(rs, rs->band_gsm, rs->band_umts,
if (rs->driver->set_band != NULL)
rs->driver->set_band(rs, rs->band_gsm, rs->band_umts,
radio_band_set_callback_at_reg, rs);
if (rs->driver->set_rat_mode == NULL)