summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Bookmarks.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-16 15:40:34 -0800
committerJohn Reck <jreck@google.com>2010-12-10 13:04:25 -0800
commit4b59db8bc6b609307dfcb346283378c5ea993d7c (patch)
treef90dd5cf3fa5bca80f69b042be77fd0d2fd539c4 /src/com/android/browser/Bookmarks.java
parent40411f008112113e769722d8d3ef8da0ef571df6 (diff)
downloadpackages_apps_Browser-4b59db8bc6b609307dfcb346283378c5ea993d7c.tar.gz
packages_apps_Browser-4b59db8bc6b609307dfcb346283378c5ea993d7c.tar.bz2
packages_apps_Browser-4b59db8bc6b609307dfcb346283378c5ea993d7c.zip
Implements the bookmark star in the History tab
Bug: 3198742 This change wires up the bookmark star in the history tab. The user can now add and remove a history item from their bookmarks. Change-Id: I98f40bb5b4d3e82a9d305e83c750d87efb11a03e
Diffstat (limited to 'src/com/android/browser/Bookmarks.java')
-rw-r--r--src/com/android/browser/Bookmarks.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/browser/Bookmarks.java
index 383ae7fc5..fef634f52 100644
--- a/src/com/android/browser/Bookmarks.java
+++ b/src/com/android/browser/Bookmarks.java
@@ -108,22 +108,21 @@ import java.io.ByteArrayOutputStream;
ContentResolver cr, String url, String title) {
Cursor cursor = null;
try {
- cursor = cr.query(BrowserContract.Bookmarks.CONTENT_URI,
+ Uri uri = BookmarkUtils.getBookmarksUri(context);
+ cursor = cr.query(uri,
new String[] { BrowserContract.Bookmarks._ID },
BrowserContract.Bookmarks.URL + " = ? AND " +
BrowserContract.Bookmarks.TITLE + " = ?",
new String[] { url, title },
null);
- // Should be in the database no matter what
if (!cursor.moveToFirst()) {
- throw new AssertionError("URL is not in the database! " + url
- + " " + title);
+ return;
}
// Remove from bookmarks
WebIconDatabase.getInstance().releaseIconForPageUrl(url);
- Uri uri = ContentUris.withAppendedId(BrowserContract.Bookmarks.CONTENT_URI,
+ uri = ContentUris.withAppendedId(BrowserContract.Bookmarks.CONTENT_URI,
cursor.getLong(0));
cr.delete(uri, null, null);
if (context != null) {