Bug 912994 - Update top sites query to exclude reading list items. r=wesj
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 25 Sep 2013 08:56:56 -0700
changeset 148564 5d3704320ce5
parent 148563 a1f4f274e5b8
child 148565 272dabb40b3d
child 148608 fa0e6916f88c
push id2828
push usermleibovic@mozilla.com
push dateWed, 25 Sep 2013 15:57:16 +0000
treeherderfx-team@5d3704320ce5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs912994
milestone27.0a1
Bug 912994 - Update top sites query to exclude reading list items. r=wesj
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 },
                               "",