diff options
author | Antara Borwankar <antara.borwankar@gmail.com> | 2016-04-28 04:30:49 +0530 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2016-04-27 11:19:13 -0500 |
commit | d8b60d854cfd8b6a3860186276f177ed940fa48b (patch) | |
tree | 6c1bb80a04604e96e7c384c99cfec21ab6cafba4 | |
parent | 29ff4dc2e49ada83989058f6398eda96a68680d9 (diff) | |
download | ofono-d8b60d854cfd8b6a3860186276f177ed940fa48b.tar.gz |
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.
-rw-r--r-- | src/radio-settings.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/radio-settings.c b/src/radio-settings.c index 5ab4e7be..8cb3d412 100644 --- a/src/radio-settings.c +++ b/src/radio-settings.c @@ -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) |