A contextual change to __ofono_modem_find_atom has caused us to enter
into offline mode prematurely. find_atom was changed to return only the
atoms that were registered, however the modem really has to know whether
the sim atom is created (not registered) in order to know whether to
wait for the SIM to be initialized or not.
In case set_online is missing, we should set online mode directly. If
we're already online then set our state to Online, otherwise check if we
should get Online.
Instead of notifying everyone of sim_inserted condition, we should
simply notify the modem directly. It is the only one interested in this
particular change.
This partly reverts an earlier commit:
9498ad6b5633e350eb529f8efbe08270d95c8003
The assumption so far was that SIM state would only go from
NOT_PRESENT -> INSERTED -> READY -> NOT_PRESENT because there's
no method to unauthenticate from SIM without removing. We need to
be able to switch to INSERTED when SIM is being reset,
reinitialised, etc. because going to NOT_PRESENT and then
immediately INSERTED would be logically wrong.
A SetProperty that doesn't actually change the Online property's state
when no change to that state is pending, should not fail. It should
always succeed regardless of the current modem state.
Setting Lockdown to TRUE means power down the modem and hold a lock that
only permits the lock's owner power up the modem back. When released
it restores the last state of the modem before holding the lock.
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)
// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@
- !E
+ E == NULL
// </smpl>
We should not notify the online watches when we enter the OFFLINE state
for the first time. We should only do so when we go from ONLINE state
into the OFFLINE state.