Loading core/java/android/provider/Browser.java +21 −8 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.database.Cursor; import android.database.DatabaseUtils; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; import android.provider.BrowserContract.Bookmarks; import android.provider.BrowserContract.Combined; import android.provider.BrowserContract.History; Loading Loading @@ -404,12 +405,17 @@ public class Browser { null, null, History.DATE_LAST_VISITED + " ASC"); if (cursor.moveToFirst() && cursor.getCount() >= MAX_HISTORY_COUNT) { final WebIconDatabase iconDb = WebIconDatabase.getInstance(); 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; } } Loading Loading @@ -469,11 +475,16 @@ public class Browser { cursor = cr.query(History.CONTENT_URI, new String[] { History.URL }, whereClause, null, null); if (cursor.moveToFirst()) { final WebIconDatabase iconDb = WebIconDatabase.getInstance(); 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); Loading Loading @@ -568,8 +579,10 @@ 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); } } /** * Column definitions for the mixed bookmark and history items available Loading Loading
core/java/android/provider/Browser.java +21 −8 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.database.Cursor; import android.database.DatabaseUtils; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; import android.provider.BrowserContract.Bookmarks; import android.provider.BrowserContract.Combined; import android.provider.BrowserContract.History; Loading Loading @@ -404,12 +405,17 @@ public class Browser { null, null, History.DATE_LAST_VISITED + " ASC"); if (cursor.moveToFirst() && cursor.getCount() >= MAX_HISTORY_COUNT) { final WebIconDatabase iconDb = WebIconDatabase.getInstance(); 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; } } Loading Loading @@ -469,11 +475,16 @@ public class Browser { cursor = cr.query(History.CONTENT_URI, new String[] { History.URL }, whereClause, null, null); if (cursor.moveToFirst()) { final WebIconDatabase iconDb = WebIconDatabase.getInstance(); 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); Loading Loading @@ -568,8 +579,10 @@ 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); } } /** * Column definitions for the mixed bookmark and history items available Loading