From 6b52a55ecd3b91ca31a0d7111f87a5d7937f215b Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Thu, 3 Sep 2009 16:29:56 -0700 Subject: [PATCH] Remove clientid from the url before it is added to the database. So that we won't show them in the auto-complete list. Update the browser.db and remove history only entries who has clientid. Fix http://b/issue?id=2099727 --- src/com/android/browser/BrowserActivity.java | 11 +++++++++++ src/com/android/browser/BrowserProvider.java | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 3b0745e..887f832 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -2701,6 +2701,17 @@ public class BrowserActivity extends Activity if (url.regionMatches(true, 0, "about:", 0, 6)) { return; } + // remove "client" before updating it to the history so that it wont + // show up in the auto-complete list. + int index = url.indexOf("client=ms-"); + if (index > 0 && url.contains(".google.")) { + int end = url.indexOf('&', index); + if (end > 0) { + url = url.substring(0, index-1).concat(url.substring(end)); + } else { + url = url.substring(0, index-1); + } + } Browser.updateVisitedHistory(mResolver, url, true); WebIconDatabase.getInstance().retainIconForPageUrl(url); } diff --git a/src/com/android/browser/BrowserProvider.java b/src/com/android/browser/BrowserProvider.java index 75a98b6..4db1ebc 100644 --- a/src/com/android/browser/BrowserProvider.java +++ b/src/com/android/browser/BrowserProvider.java @@ -151,7 +151,8 @@ public class BrowserProvider extends ContentProvider { // 18 -> 19 Remove labels table // 19 -> 20 Added thumbnail // 20 -> 21 Added touch_icon - private static final int DATABASE_VERSION = 21; + // 21 -> 22 Remove "clientid" + private static final int DATABASE_VERSION = 22; // Regular expression which matches http://, followed by some stuff, followed by // optionally a trailing slash, all matched as separate groups. @@ -261,6 +262,9 @@ public class BrowserProvider extends ContentProvider { } if (oldVersion < 21) { db.execSQL("ALTER TABLE bookmarks ADD COLUMN touch_icon BLOB DEFAULT NULL;"); + } + if (oldVersion < 22) { + db.execSQL("DELETE FROM bookmarks WHERE (bookmark = 0 AND url LIKE \"%.google.%client=ms-%\")"); } else { db.execSQL("DROP TABLE IF EXISTS bookmarks"); db.execSQL("DROP TABLE IF EXISTS searches"); -- 2.11.0