As soon as the user clicks on a link to download a file Gecko will start the download - even before prompting the
user. This led to problems when the user hadn't granted the permission to write to the downloads directory yet. The
download would fail even though the user (later) accepted the permission.
With this patch we will start the download to the app's cache directory (only if we do not have the permission) and
prompt the user. As soon as the user has accepted the permission the download will be moved to the public downloads
directory (even while still downloading). If the permission is denied the download will be cancelled.
After the permission has been granted all subsequent downloads will start writing to the downloads directory
directly.
MozReview-Commit-ID: CCqk9h7Sxor
LoginsProvider is an all-Android implementation of PasswordsProvider.
PasswordsProvider is an SQLite database backed by the version of
SQLite that ships with Gecko. It is concurrently accessed from Gecko
and it runs with a special lifecycle that includes a separate
heavy-weight process. Eventually we'll migrate the Gecko-side
passwords interface to use the new Android-side LoginsProvider, but
for now we just want to get the new provider landed and the tests
running.
MozReview-Commit-ID: Bx19D68tMtI
***
Bug 946857 - Fold into part2: review nits.
MozReview-Commit-ID: LmPwIvebfrr
LoginsProvider is an all-Android implementation of PasswordsProvider.
PasswordsProvider is an SQLite database backed by the version of
SQLite that ships with Gecko. It is concurrently accessed from Gecko
and it runs with a special lifecycle that includes a separate
heavy-weight process. Eventually we'll migrate the Gecko-side
passwords interface to use the new Android-side LoginsProvider, but
for now we just want to get the new provider landed and the tests
running.
MozReview-Commit-ID: Bx19D68tMtI
***
Bug 946857 - Fold into part2: review nits.
MozReview-Commit-ID: LmPwIvebfrr
This is a quick sanity check: a clean profile should return all the suggested
sites directly.
We should probably add further tests making sure that history items appear
in front of the suggested sites, that pinned sites work correctly,
and that suggested sites don't appear outside of the grid.
MozReview-Commit-ID: Ai8gTkv9E9w
This means we now have only one open cursor for the topsites query, instead of 2 real cursors (and one
MatrixCursor). We still need a MergeCursor and MatrixCursor to supply blank tiles, this will
disappear as soon as the user has sufficient history items to fill the suggested sites grid.
MozReview-Commit-ID: LnJaSMIDM2O
Note that this version only returns topsites, pinned sites, and suggested sites.
Blank tiles aren't supplied, and need to be added separately.
MozReview-Commit-ID: 5Vc5pXTewHi
We'll need access to the SuggestedSites in BrowserProvider when assembling the
topsites query there, hence we need to allow access via BrowserDB.
MozReview-Commit-ID: BkZghDhQGxr
This allows us to more easily append multiple sets of args.
TODO: is it worth naming this appendSelectionArgs? We should keep the
2-param version appendSelectionArgs since it's more efficient for that
case (and the vast majority of uses are with 2-params) - it's probably
simpler for development to have both versions have the same name, and
as far as I can tell the compiler will prefer the non varargs version
when possible.
MozReview-Commit-ID: LcI6zNwpIxh
Otherwise we will crash with a java.util.ConcurrentModificationException on iterator.next()
after removing an item using list.remove(item).
MozReview-Commit-ID: KYebSw2zjVk
Currently tests version 27 to 28 and is abstract enough to test future
upgrades. Additionally, the test should fail if the database is upgraded but a
database for the old version is not supplied.
MozReview-Commit-ID: CpBiGETFacv