rilmodem/ofono — pull request #43 by tonyespy (2013-12-19 23:31:22+00:00)
Title: Ril power fix

This pull request modifies the start-up logic of the ril modem plugin, as the original code has a race condition that could adversely affect SIM IO, and occasionally SIM status operations. The race was due to the fact that the modem power on was controlled by an external entity ( currently telepathy-ofono ), yet the plugin would issue a GET_SIM_STATUS request on it's own without any verification that the modem had powered up.

The code now waits for a radio state change that indicates that the modem is ON, before sending a get_sim_status().

This has been tested on both maguro (r62) and mako (r62). Note, this change is also needed in order to get ofono/rilmodem to work with the Touch emulator.

The following testing was performed:

1. Disable telepathy-ofono & NetworkManager; verify that the modem can be toggled online/offline using the ofono-scripts. Note, the following pull request is required on mako to prevent a related crash:

https://github.com/rilmodem/ofono/pull/42

2. With telepathy-ofono and NetworkManager re-enabled, the following basic tests were run:
- voice calls: in / out
- SMS: in / out
- GPRS: verified online

Finally, note in the function ril_pre_sim(), an assert was added to ensure that the ofono_sim driver was created, as without it, not much can be done. The only failure cases are out-of-memory, and incorrect driver specified.