зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
05b2656e93
Коммит
2c478e100e
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче