summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/platformsupport
diff options
context:
space:
mode:
authorAxesh R. Ajmera <aajmera@codeaurora.org>2014-10-22 11:07:37 -0700
committerWebTech Code Review <code-review@localhost>2014-10-27 10:35:25 -0700
commit51ffe182b59285b01d9d09932663e466659f9f9b (patch)
tree486980502524fa60d45b8656d979dde5dac9ee2e /src/com/android/browser/platformsupport
parent3d150617abcb3ab40abc1e17f370936ed3e66292 (diff)
downloadandroid_packages_apps_Gello-51ffe182b59285b01d9d09932663e466659f9f9b.tar.gz
android_packages_apps_Gello-51ffe182b59285b01d9d09932663e466659f9f9b.tar.bz2
android_packages_apps_Gello-51ffe182b59285b01d9d09932663e466659f9f9b.zip
Remove references to WebIconDatabase
Since WebIconDatabase is deprecated and most of its operations are no op even in frameworks from Kitkat and above. The dead code is removed from browser. Change-Id: If1b126bb8d460915e2e3c5da1cb3d76622ed14ff
Diffstat (limited to 'src/com/android/browser/platformsupport')
-rw-r--r--src/com/android/browser/platformsupport/Browser.java51
1 files changed, 6 insertions, 45 deletions
diff --git a/src/com/android/browser/platformsupport/Browser.java b/src/com/android/browser/platformsupport/Browser.java
index a5346eb9..feb9f87c 100644
--- a/src/com/android/browser/platformsupport/Browser.java
+++ b/src/com/android/browser/platformsupport/Browser.java
@@ -26,7 +26,6 @@ import android.database.DatabaseUtils;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.util.Log;
-import android.webkit.WebIconDatabase;
import com.android.browser.R;
import com.android.browser.platformsupport.BrowserContract.Bookmarks;
@@ -157,8 +156,8 @@ public class Browser {
* @param title Title for the bookmark. Can be null or empty string.
* @param url Url for the bookmark. Can be null or empty string.
*/
- public static final void saveBookmark(Context c,
- String title,
+ public static final void saveBookmark(Context c,
+ String title,
String url) {
Intent i = new Intent(Intent.ACTION_INSERT, Browser.BOOKMARKS_URI);
i.putExtra("title", title);
@@ -235,10 +234,10 @@ public class Browser {
*
* @param cr The ContentResolver used to access the database.
*/
- public static final Cursor getAllBookmarks(ContentResolver cr) throws
+ public static final Cursor getAllBookmarks(ContentResolver cr) throws
IllegalStateException {
return cr.query(Bookmarks.CONTENT_URI,
- new String[] { Bookmarks.URL },
+ new String[] { Bookmarks.URL },
Bookmarks.IS_FOLDER + " = 0", null, null);
}
@@ -399,19 +398,17 @@ public class Browser {
// TODO make a single request to the provider to do this in a single transaction
Cursor cursor = null;
try {
-
+
// Select non-bookmark history, ordered by date
cursor = cr.query(History.CONTENT_URI,
new String[] { History._ID, History.URL, History.DATE_LAST_VISITED },
null, null, History.DATE_LAST_VISITED + " ASC");
if (cursor.moveToFirst() && cursor.getCount() >= MAX_HISTORY_COUNT) {
- final WebIconDatabase 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);
- iconDb.releaseIconForPageUrl(cursor.getString(1));
if (!cursor.moveToNext()) break;
}
}
@@ -471,13 +468,6 @@ public class Browser {
cursor = cr.query(History.CONTENT_URI, new String[] { History.URL }, whereClause,
null, null);
if (cursor.moveToFirst()) {
- final WebIconDatabase iconDb = WebIconDatabase.getInstance();
- do {
- // Delete favicons
- // TODO don't release if the URL is bookmarked
- iconDb.releaseIconForPageUrl(cursor.getString(0));
- } while (cursor.moveToNext());
-
cr.delete(History.CONTENT_URI, whereClause, null);
}
} catch (IllegalStateException e) {
@@ -522,7 +512,7 @@ public class Browser {
* @param cr The ContentResolver used to access the database.
* @param url url to remove.
*/
- public static final void deleteFromHistory(ContentResolver cr,
+ public static final void deleteFromHistory(ContentResolver cr,
String url) {
cr.delete(History.CONTENT_URI, History.URL + "=?", new String[] { url });
}
@@ -558,35 +548,6 @@ public class Browser {
}
/**
- * Request all icons from the database. This call must either be called
- * in the main thread or have had Looper.prepare() invoked in the calling
- * thread.
- * Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
- * @param cr The ContentResolver used to access the database.
- * @param where Clause to be used to limit the query from the database.
- * Must be an allowable string to be passed into a database query.
- * @param listener IconListener that gets the icons once they are
- * retrieved.
- */
- public static final void requestAllIcons(ContentResolver cr, String where,
- WebIconDatabase.IconListener listener) {
- try {
- final Cursor c = cr.query(BOOKMARKS_URI, HISTORY_PROJECTION,
- where, null, null);
- if (c.moveToFirst()) {
- final WebIconDatabase db = WebIconDatabase.getInstance();
- do {
- db.requestIconForPageUrl(c.getString(HISTORY_PROJECTION_URL_INDEX),
- listener);
- } while (c.moveToNext());
- }
- c.deactivate();
- } catch (IllegalStateException e) {
- Log.e(LOGTAG, "requestAllIcons", e);
- }
- }
-
- /**
* Column definitions for the mixed bookmark and history items available
* at {@link #BOOKMARKS_URI}.
*/