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

Commit b7c39cee authored by Justin Koh's avatar Justin Koh
Browse files

Remove WebIconDatabase calls from android.provider.Browser

This class has been deprecated, so no need to call it.

Bug: 15088030
Change-Id: I6092a9d5f7a12cc14def0996efff7cb689935acb
parent 3f175a35
Loading
Loading
Loading
Loading
+9 −30
Original line number Diff line number Diff line
@@ -405,17 +405,10 @@ public class Browser {
                    null, null, History.DATE_LAST_VISITED + " ASC");

            if (cursor.moveToFirst() && cursor.getCount() >= MAX_HISTORY_COUNT) {
                WebIconDatabase iconDb = null;
                if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {                  
                    iconDb = WebIconDatabase.getInstance();
                }
                /* eliminate oldest history items */
                for (int i = 0; i < TRUNCATE_N_OLDEST; i++) {
                    cr.delete(ContentUris.withAppendedId(History.CONTENT_URI, cursor.getLong(0)),
                        null, null);
                    if (iconDb != null) {
                        iconDb.releaseIconForPageUrl(cursor.getString(1));
                    }
                    if (!cursor.moveToNext()) break;
                }
            }
@@ -475,18 +468,6 @@ public class Browser {
            cursor = cr.query(History.CONTENT_URI, new String[] { History.URL }, whereClause,
                    null, null);
            if (cursor.moveToFirst()) {
                WebIconDatabase iconDb = null;
                if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
                    iconDb = WebIconDatabase.getInstance();
                }
                do {
                  // Delete favicons
                  // TODO don't release if the URL is bookmarked
                  if (iconDb != null) {                    
                      iconDb.releaseIconForPageUrl(cursor.getString(0));
                  }
                } while (cursor.moveToNext());

                cr.delete(History.CONTENT_URI, whereClause, null);
            }
        } catch (IllegalStateException e) {
@@ -579,9 +560,7 @@ public class Browser {
     */
    public static final void requestAllIcons(ContentResolver cr, String where,
            WebIconDatabase.IconListener listener) {
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
            WebIconDatabase.getInstance().bulkRequestIconForPageUrl(cr, where, listener);
        }
        // Do nothing: this is no longer used.
    }

    /**