This commit should be faily self-explainatory. It splits the
three autodiscovery methods into their own gradle builds so
they can be plugged in and out easily. This commit doesn't
necessarily make the latter possible though.
Dependency graph should look something like this now:
app:ui
\
\app:autodiscovery:api
|
|\app:autodiscovery:providersxml
|
|\app:autodiscovery:srvrecords
|
\app:autodiscovery:thunderbird
In a similar fashion to SrvServiceDiscovery, this commit allows
ThunderbirdAutoconfig to only get the type of service needed
depending on DiscoveryTarget
Rename sorting Comparator to mailServicePriority
Creates a new data class: DiscoveryResults that holds a list of incoming
and outgoing DiscoveryServerSettings. This commit also creates a wrapper
for the currently used ProvidersXmlDiscovery to convert the new
DiscoveryResults object into ConnectionSettings.
In the future, this process will have a less-lazy algorithm that will be
smart enough to handle more than one incoming/outgoing server but this
commit assumes there are still one of each (by assertion).
Use enum to determine discovery target
Sort SrvServiceDiscovery results using pickMailService
Previously special local folders were created every time the server
settings were checked. The folders weren't created when the server settings
check would encounter an error, e.g. if there was no internet connectivity,
but the user decided to continue anyway.
We were using the old format server ID (UTF-7 decoded, with prefix removed)
to create and update folders. But we used the proper server ID to figure out
which folders to remove locally. This could lead to too many folders being
removed. They'd be added back the next time the folder list was refreshed
and then be removed again the next refresh after that.
This way AppCompat's VectorDrawable implementation will be used. It works
around a couple of platform bugs.
We can't use this mechanism in layouts that we don't inflate ourselves,
e.g. the message list widget layout.