Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73f7537b authored by Patrick Scott's avatar Patrick Scott
Browse files

Limit the projection to just the url.

Todo: bulk request the icons to avoid posting a billion messages.

Bug: 2496872
Change-Id: I6298f8d6f3000cfbbf56c6bed5f98b9836706f6d
parent aa27045a
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -608,22 +608,24 @@ public class Browser {
     */
    public static final void requestAllIcons(ContentResolver cr, String where,
            WebIconDatabase.IconListener listener) {
        Cursor c = null;
        try {
            final Cursor c = cr.query(
            c = cr.query(
                    BOOKMARKS_URI,
                    HISTORY_PROJECTION,
                    new String[] { BookmarkColumns.URL },
                    where, null, null);
            if (c.moveToFirst()) {
                final WebIconDatabase db = WebIconDatabase.getInstance();
                do {
                    db.requestIconForPageUrl(
                            c.getString(HISTORY_PROJECTION_URL_INDEX), 
                            listener);
                    db.requestIconForPageUrl(c.getString(0), listener);
                } while (c.moveToNext());
            }
            c.deactivate();
        } catch (IllegalStateException e) {
            Log.e(LOGTAG, "requestAllIcons", e);
        } finally {
            if (c != null) {
                c.close();
            }
        }
    }