This adds a new IntentService to pre-process Intents that request a
new repo is added. Right now, this only handles Intents that come
from the new storage scanners.
This also adds a new case to the AddRepo UI logic to cover when an
incoming Intent is for a mirror that is already included in an enabled
repo. In that case, the user is show the Repo Details screen for the
repo that includes that mirror. This is done is a hacky way right now
since the only path through is to click the button. So this clicks
the button in code.
Creates an IntentService subclass for scanning removable "external
storage" for F-Droid package repos, e.g. SD Cards. This is intented to
support sharable package repos, so it ignores non-removable storage,
like the fake emulated sdcard from devices with only built-in storage.
This method will only ever allow for reading repos, never writing. It
also will not work for removeable storage devices plugged in via USB,
since do not show up as "External Storage"
* https://stackoverflow.com/a/40201333
* https://commonsware.com/blog/2017/11/14/storage-situation-external-storage.htmlcloses#1377
This uses the new Storage Access Framework, which was required for
accessing files on the SD Card starting in android-19. But the API
was really limited until android-21, and not really complete until
android-23 or even android-26. So the levels of usability will vary a
lot based on how new the version of Android is.
The mirror logic assumes that it has a mirrors list with at least once
valid entry in it. In the index format as defined by `fdroid update`,
there is always at least one valid URL: the canonical URL. That also
means if there is only one item in the mirrors list, there are no
other URLs to try.
The initial state of the repos in the database also include the canonical
URL in the mirrors list so the mirror logic works on the first index
update. That makes it possible to do the first index update via SD Card
or USB OTG drive.
* jsonLoader: (28 commits)
fix checkstyle complaints
force DBHelperTest.canAddAdditionalRepos() to run on CI
clean up whitespace in repo descriptions
rename parseXmlRepos to parseAdditionalReposXml
rename item lists to repoItems
rename defaultReposFile to additionalReposFile
separate defaultRepos from initialRepos, which includes additionalRepos
rename REPO_XML_ARG_COUNT to REPO_XML_ITEM_COUNT
fix additional_repos.xml handling to be properly parsed
move comments to javadoc
priority is NOT ignored, just additional_repos.xml is not allowed to set
fix DBHelperTest to actually load and parse additional_repos.xml
changed the tests: now testing only DBHelper.parseXmlRepos()
removed stars from imports
finished additional repos test
some minor style changes
minor style changes
implemented creating xml file on oem partition; not sure whether it works cause gradle runs forever (>20min)
started implementing test
removed priority from additional_repos.xml
...
closesfdroid/fdroidclient!705