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 148604 5d3704320ce5
parent 148603 a1f4f274e5b8
child 148605 fa0e6916f88c
child 148728 272dabb40b3d
push id25348
push userryanvm@gmail.com
push dateWed, 25 Sep 2013 18:38:07 +0000
treeherdermozilla-central@fa0e6916f88c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs912994
milestone27.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 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 },
                               "",