net: Do not keep reconnecting on "useless" changes of the current session
Warning: this is apparently black magic. One day someone should go
through Qt's code, check why the hell they are emitting these signals,
and make sure that they only hit us when the network configuration has
actually changed.
In the meanwhile, this patch makes sure that we only initiate switching
to another session in case our current one changes and is not active
anymore (old behavior prior to this patch) *and* if the system actually
has some other default session.
It turns out that I'm hitting this because I have my phone plugged in
via USB for charging, and this creates a cdc_ncm interface. That
interface (two of them, actually) does not have a default route (just
some local auto-assigned crap), but Qt is nonetheless returning it from
a QNetworkConfigurationManager::defaultConfiguration(). This sounds like
a Qt bug which should be patched at that level; applications should not
be required to handle this on their own. But if this educated guess
happens to be correct, then it seems that this patch is actually a good
thing...
Change-Id: I06f14837b2411c5b2ea68fc22b1a9667d70ecb3d