Bug 912994 - Update top sites query to exclude reading list items. r=wesj

This commit is contained in:
Margaret Leibovic 2013-09-25 08:56:56 -07:00
parent 5939f3d97a
commit 8302763d2a

View File

@ -232,12 +232,13 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
@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,