mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 734624 - java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask.done(AsyncTask.java) caused by: android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed, synchronize inserts to avoid race condition r=lucasr
This commit is contained in:
parent
88035a4af3
commit
380a975254
@ -256,12 +256,16 @@ public class Favicons {
|
||||
|
||||
// Runs in background thread
|
||||
private void saveFaviconToDb(BitmapDrawable favicon) {
|
||||
Log.d(LOGTAG, "Saving favicon on browser database for URL = " + mPageUrl);
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
BrowserDB.updateFaviconForUrl(resolver, mPageUrl, favicon);
|
||||
// since the Async task can run this on any number of threads in the
|
||||
// pool, we need to protect against inserting the same url twice
|
||||
synchronized(mDbHelper) {
|
||||
Log.d(LOGTAG, "Saving favicon on browser database for URL = " + mPageUrl);
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
BrowserDB.updateFaviconForUrl(resolver, mPageUrl, favicon);
|
||||
|
||||
Log.d(LOGTAG, "Saving favicon URL for URL = " + mPageUrl);
|
||||
mDbHelper.setFaviconUrlForPageUrl(mPageUrl, mFaviconUrl);
|
||||
Log.d(LOGTAG, "Saving favicon URL for URL = " + mPageUrl);
|
||||
mDbHelper.setFaviconUrlForPageUrl(mPageUrl, mFaviconUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Runs in background thread
|
||||
|
Loading…
Reference in New Issue
Block a user