Bug 1250707 - Add insert method to url annotations table in BrowserProvider. r=sebastian

MozReview-Commit-ID: 8clkXPqmpOV

--HG--
extra : rebase_source : 5369686567ff03734015ae3e0fd6ab26c57d2f86
This commit is contained in:
Michael Comella 2016-02-25 15:28:28 -08:00
Родитель 05b2656e93
Коммит 2c478e100e
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -508,6 +508,12 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
break;
}
case URL_ANNOTATIONS: {
trace("Insert on URL_ANNOTATIONS: " + uri);
id = insertUrlAnnotation(uri, values);
break;
}
default: {
Table table = findTableFor(match);
if (table == null) {
@ -1213,6 +1219,15 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
return db.insertOrThrow(TABLE_THUMBNAILS, null, values);
}
private long insertUrlAnnotation(final Uri uri, final ContentValues values) {
final String url = values.getAsString(UrlAnnotations.URL);
trace("Inserting url annotations for URL: " + url);
final SQLiteDatabase db = getWritableDatabase(uri);
beginWrite(db);
return db.insertOrThrow(TABLE_URL_ANNOTATIONS, null, values);
}
private int updateOrInsertThumbnail(Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
return updateThumbnail(uri, values, selection, selectionArgs,