Bug 1062552 - Use empty string as title if no title provided when adding a bookmark. r=ckitching, a=lmandel
authorRichard Newman <rnewman@mozilla.com>
Wed, 03 Sep 2014 14:41:35 -0700
changeset 224839 f1503773fdaef7fba5628f251f3cd09b50025a28
parent 224838 9adeeef7fafebfd3b8e99579de95c16bfd586de7
child 224840 ad669f12074400307f00853ebef02f1092a8c66d
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckitching, lmandel
bugs1062552
milestone34.0a2
Bug 1062552 - Use empty string as title if no title provided when adding a bookmark. r=ckitching, a=lmandel
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);
     }