qcommsimmodem: Fix setting 3G preference when one of the slot is empty. #228

Merged
merged 2 commits into from Feb 25, 2016

Conversation

Projects
None yet
2 participants
Contributor

peat-psuwit commented Feb 21, 2016

Normally, to set a slot as 3G when there are 2 SIMs in the device, radio settings must set other slot to 2G first. But if the other slot is empty, this action will fail. This PR make sure that radio settings will skip the empty slot. Along the way, I've refactored code around so that the code is cleaner.

Contributor

alfonsosanchezbeato commented Feb 24, 2016

Adding ril_sim_get_state() to ril.c is not needed: as you already have ofono_modem available in qcommsimmodem/radio-settings.c, you can call __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM) and check the SIM status directly.

Contributor

peat-psuwit commented Feb 24, 2016

Oh, thank you for that. I was finding way to accomplished that. I'll re-implement that code.

Contributor

peat-psuwit commented Feb 24, 2016

Ok, new version pushed.

drivers/qcommsimmodem/radio-settings.c
@@ -76,6 +77,24 @@ static void qcom_msim_set_rat_cb(struct ril_msg *message, gpointer user_data)
}
}
+static void qcom_msim_do_set_rat_mode(struct ofono_radio_settings *rs, int pref
+ , struct cb_data *cbd) {
@alfonsosanchezbeato

alfonsosanchezbeato Feb 25, 2016

Contributor

Do not split the line between a variable and a comma, and also that "{" should be starting a line.

Contributor

alfonsosanchezbeato commented Feb 25, 2016

Looks good, there is just a formatting issue.

peat-psuwit added some commits Nov 24, 2015

qcommsimmodem: skip empty slot when set 2G radio pref.
Normally, to set a slot as 3G when there are 2 SIMs in the device,
radio settings must set other slot to 2G first. But if the other
slot is empty, this action will fail. This commit make sure that
radio settings will skip the empty slot. Along the way, I've
refactored code around so that the code is cleaner.
Contributor

peat-psuwit commented Feb 25, 2016

New version pushed.

alfonsosanchezbeato added a commit that referenced this pull request Feb 25, 2016

Merge pull request #228 from peat-psuwit/lg-d410-set-2g-with-single-sim
qcommsimmodem: Fix setting 3G preference when one of the slot is empty.

@alfonsosanchezbeato alfonsosanchezbeato merged commit 1d27df0 into rilmodem:master Feb 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment