Bug 912994 - Update top sites query to exclude reading list items. r=wesj, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 25 Sep 2013 08:56:56 -0700
changeset 155839 9e5e23f67e31
parent 155838 f081b1e1b442
child 155840 89458280a982
push id4441
push userryanvm@gmail.com
push dateFri, 18 Oct 2013 21:12:13 +0000
treeherdermozilla-aurora@2718af9506b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, lsblakk
bugs912994
milestone26.0a2
Bug 912994 - Update top sites query to exclude reading list items. r=wesj, a=lsblakk
mobile/android/base/db/LocalBrowserDB.java
--- a/mobile/android/base/db/LocalBrowserDB.java
+++ b/mobile/android/base/db/LocalBrowserDB.java
@@ -227,22 +227,23 @@ public class LocalBrowserDB implements B
                                              Combined.HISTORY_ID },
                               constraint,
                               limit,
                               null);
     }
 
     @Override
     public Cursor getTopSites(ContentResolver cr, int limit) {
-        // Filter out sites that are pinned
+        // Filter out bookmarks that don't have real parents (e.g. pinned sites or reading list items)
         String selection = DBUtils.concatenateWhere("", Combined.URL + " NOT IN (SELECT " +
                                              Bookmarks.URL + " FROM bookmarks WHERE " +
-                                             DBUtils.qualifyColumn("bookmarks", Bookmarks.PARENT) + " == ? AND " +
+                                             DBUtils.qualifyColumn("bookmarks", Bookmarks.PARENT) + " < ? AND " +
                                              DBUtils.qualifyColumn("bookmarks", Bookmarks.IS_DELETED) + " == 0)");
-        String[] selectionArgs = DBUtils.appendSelectionArgs(new String[0], new String[] { String.valueOf(Bookmarks.FIXED_PINNED_LIST_ID) });
+        String[] selectionArgs = new String[] { String.valueOf(Bookmarks.FIXED_ROOT_ID) };
+
         return filterAllSites(cr,
                               new String[] { Combined._ID,
                                              Combined.URL,
                                              Combined.TITLE,
                                              Combined.DISPLAY,
                                              Combined.BOOKMARK_ID,
                                              Combined.HISTORY_ID },
                               "",