summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/Bookmarks.java8
-rw-r--r--src/com/android/browser/BrowserBookmarksAdapter.java3
-rw-r--r--src/com/android/browser/BrowserBookmarksPage.java2
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java2
-rw-r--r--src/com/android/browser/HistoryItem.java2
5 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/browser/Bookmarks.java
index a3dc919..40aaa63 100644
--- a/src/com/android/browser/Bookmarks.java
+++ b/src/com/android/browser/Bookmarks.java
@@ -162,17 +162,17 @@ import java.util.Date;
* @param url URL of the website to be removed.
*/
/* package */ static void removeFromBookmarks(Context context,
- ContentResolver cr, String url) {
+ ContentResolver cr, String url, String title) {
Cursor cursor = cr.query(
Browser.BOOKMARKS_URI,
Browser.HISTORY_PROJECTION,
- "url = ?",
- new String[] { url },
+ "url = ? AND title = ?",
+ new String[] { url, title },
null);
boolean first = cursor.moveToFirst();
// Should be in the database no matter what
if (!first) {
- throw new AssertionError("URL is not in the database!");
+ throw new AssertionError("URL is not in the database! " + url + " " + title);
}
// Remove from bookmarks
WebIconDatabase.getInstance().releaseIconForPageUrl(url);
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index 36af1fc..6b464cc 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -188,7 +188,8 @@ class BrowserBookmarksAdapter extends BaseAdapter {
}
mCursor.moveToPosition(position- mExtraOffset);
String url = mCursor.getString(Browser.HISTORY_PROJECTION_URL_INDEX);
- Bookmarks.removeFromBookmarks(null, mContentResolver, url);
+ String title = mCursor.getString(Browser.HISTORY_PROJECTION_TITLE_INDEX);
+ Bookmarks.removeFromBookmarks(null, mContentResolver, url, title);
refreshList();
}
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index 23fcc5a..019806c 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -154,7 +154,7 @@ public class BrowserBookmarksPage extends Activity implements
// If the site is bookmarked, the item becomes remove from
// bookmarks.
if (isBookmark) {
- Bookmarks.removeFromBookmarks(this, getContentResolver(), url);
+ Bookmarks.removeFromBookmarks(this, getContentResolver(), url, name);
} else {
Browser.saveBookmark(this, name, url);
}
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index d364c9c..9c9dc60 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -238,7 +238,7 @@ public class BrowserHistoryPage extends ExpandableListActivity {
case R.id.save_to_bookmarks_menu_id:
if (historyItem.isBookmark()) {
Bookmarks.removeFromBookmarks(this, getContentResolver(),
- url);
+ url, title);
} else {
Browser.saveBookmark(this, title, url);
}
diff --git a/src/com/android/browser/HistoryItem.java b/src/com/android/browser/HistoryItem.java
index e8f15b1..9d6dec7 100644
--- a/src/com/android/browser/HistoryItem.java
+++ b/src/com/android/browser/HistoryItem.java
@@ -49,7 +49,7 @@ import android.widget.TextView;
mContext.getContentResolver(), mUrl, getName(), true);
} else {
Bookmarks.removeFromBookmarks(mContext,
- mContext.getContentResolver(), mUrl);
+ mContext.getContentResolver(), mUrl, getName());
}
}
};