Do not insert duplicate urls into the browser database.

Move the logic for finding similar URLs to frameworks/base,
and use it in addBookmark.  In BrowserActivity, call smartUrlFilter
before calling updateVisitedHistory, so the '/' will be appended
before adding to the database.

Part of fix for http://b/issue?id=2442391

Depends on a change to frameworks/base
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 1d57f67..0bf370c 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -722,11 +722,11 @@
                 url = intent.getStringExtra(SearchManager.QUERY);
                 if (url != null) {
                     mLastEnteredUrl = url;
-                    Browser.updateVisitedHistory(mResolver, url, false);
                     // In general, we shouldn't modify URL from Intent.
                     // But currently, we get the user-typed URL from search box as well.
                     url = fixUrl(url);
                     url = smartUrlFilter(url);
+                    Browser.updateVisitedHistory(mResolver, url, false);
                     String searchSource = "&source=android-" + GOOGLE_SEARCH_SOURCE_SUGGEST + "&";
                     if (url.contains(searchSource)) {
                         String source = null;