Daniel Martí ac0ab7e211 Merge branch 'fix-265--database-locked-crash' into 'master'
Fix 265  database locked crash (I'm pretty sure)

Previously, all of the various subclasses of FDroidProvider would create
their own database open helper in their respective `onCreate()` methods.
This seemed to be the cause of the multiple database locked exceptions.

Various online articles/SO posts/etc helped come to this conclusion:
 * http://stackoverflow.com/a/3689883
 * http://stackoverflow.com/a/8888606
 * https://web.archive.org/web/20150709074733/http://www.dmytrodanylyk.com/pages/blog/concurrent-database.html

This should fix #265.

In the process, also did away with the two `read()` and `write()` methods
that returned a "readable" and "writeable" database respectively. It turns
out that it doesn't quite do what I originally thought. There is not much
benefit to specifying to the database helper that you want a readable/writeable
database. In fact, it is often the case that a call to `read()` would most
likely have returned the same instance that is returned by `write()`. The
semantics of them were therefore broken, and they've been replaced with
`db()`.

See merge request !196
2016-01-26 11:38:34 +00:00
..
2015-10-04 08:14:48 -07:00
2016-01-25 11:34:20 +00:00
2016-01-19 15:21:28 +01:00
2015-12-29 12:27:15 +01:00