Instead of hardcoding the logic to decide which ports are open or closed in the
different steps, we now let the subclasses of MMBroadbandModem to do that
themselves.
We now provide:
* initialization_started() and initialization_stopped(): the generic
implementation does the serial port open/close in these steps.
* enabling_started(): the generic implementation does the serial port opening
here. The serial ports are kept open as long the modem is in enabled state.
* disabling_stopped(): the generic implementation does the serial port closing
here.
Instead of providing a method to get if a plugin is requesting to get sorted
last, we provide a way to comparing two plugins, compatible with the
GCompareFunc required in g_list_sort().
There's no real point in maintaining a separate `MMPlugin' interface, as all the
plugins will inherit from `MMPluginBase', so just merge them and simplify
everything.
The plugin manager no longer needs to take care of keeping track of which probes
are being run and to which physical device they correspond, as the upper layer's
`MMDevice' already does this. This simplifies the internal logic quite a lot, as
we can now easily suggest plugins to the remaining port probes of the same
device directly.
We no longer need to query the plugin manager whether we're checking support for
a specific port, as the ports are now grabbed only once in the MMDevice, and
therefore we ensure that supports check is launched only once in the
PluginManager for that specific port.
Also, we no longer need to query the plugin manager whether we're checking
support for a given device, as the logic to check when all ports of the device
are probed is now maintained internally.
The new `mm_plugin_manager_find_device_support()' will be an async method which
waits for ports to be added in the given `MMDevice'. As soon as all added ports
are probed, the device support check is considered finished.
Before this, we only exported the modem to DBus when all ports were organized,
in order to make sure that we select as primary port the one we really want and
not the first AT port grabbed. Given that to get all the ports organized we also
needed to wait to get all the ports grabbed, we can now also defer the creation
of the modem object until all the ports get grabbed. This allows us to create
different types of objects based on the ports available (e.g. we can now create
QMI-supported modem objects if we see a QMI port around).