this patch provides the handling for the modem-depending powered timeout
It provides the trivial implementation for
ofono_modem_set_powered_timeout_hint, introducing the ofono_modem
variable timeout_hint, used together with the existing ofono_modem
variable timeout.
The default value, previously hardcoded as a magic number, is provided
by the DEFAULT_POWERED_TIMEOUT define and set as soon as the
ofono_modem struct is created, and then can be overwritten by the
aforementioned ofono_modem_set_powered_timeout_hint.
Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
This can be set by the modem driver to indicate that the device is
always in the online state when it is enabled. This is useful for
modem drivers that handle both CDMA and GSM devices.
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.