Bug 1062552 - Use empty string as title if no title provided when adding a bookmark. r=ckitching
authorRichard Newman <rnewman@mozilla.com>
Wed, 03 Sep 2014 14:41:35 -0700
changeset 203446 ee1cfc2406f5be412a702195ba241c34a917ab3b
parent 203445 65e611823b0fec328d56244143eae71fe019315c
child 203447 1d4e40dab49d4b9051e397bf8f2fc51a5c11a7f4
push id27427
push userryanvm@gmail.com
push dateThu, 04 Sep 2014 02:32:42 +0000
treeherdermozilla-central@776fa9cf70cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckitching
bugs1062552
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1062552 - Use empty string as title if no title provided when adding a bookmark. r=ckitching
mobile/android/base/db/BrowserProvider.java
--- a/mobile/android/base/db/BrowserProvider.java
+++ b/mobile/android/base/db/BrowserProvider.java
@@ -973,16 +973,22 @@ public class BrowserProvider extends Sha
         }
 
         if (!values.containsKey(Bookmarks.POSITION)) {
             debug("Inserting bookmark with no position for URI");
             values.put(Bookmarks.POSITION,
                        Long.toString(BrowserContract.Bookmarks.DEFAULT_POSITION));
         }
 
+        if (!values.containsKey(Bookmarks.TITLE)) {
+            // Desktop Places barfs on insertion of a bookmark with no title,
+            // so we don't store them that way.
+            values.put(Bookmarks.TITLE, "");
+        }
+
         String url = values.getAsString(Bookmarks.URL);
 
         debug("Inserting bookmark in database with URL: " + url);
         final SQLiteDatabase db = getWritableDatabase(uri);
         beginWrite(db);
         return db.insertOrThrow(TABLE_BOOKMARKS, Bookmarks.TITLE, values);
     }