url = intent.getStringExtra(SearchManager.QUERY);
if (url != null) {
mLastEnteredUrl = url;
- // Don't add Urls, just search terms.
- // Urls will get added when the page is loaded.
- if (!Patterns.WEB_URL.matcher(url).matches()) {
- Browser.updateVisitedHistory(mResolver, url, false);
- }
+ 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);
"bookmarks", "searches"
};
private static final String[] SUGGEST_PROJECTION = new String[] {
- "_id", "url", "title", "bookmark"
+ "_id", "url", "title", "bookmark", "user_entered"
};
private static final String SUGGEST_SELECTION =
- "url LIKE ? OR url LIKE ? OR url LIKE ? OR url LIKE ?"
- + " OR title LIKE ?";
+ "(url LIKE ? OR url LIKE ? OR url LIKE ? OR url LIKE ?"
+ + " OR title LIKE ?) AND (bookmark = 1 OR user_entered = 1)";
private String[] SUGGEST_ARGS = new String[5];
// shared suggestion array index, make sure to match COLUMNS
// 19 -> 20 Added thumbnail
// 20 -> 21 Added touch_icon
// 21 -> 22 Remove "clientid"
- private static final int DATABASE_VERSION = 22;
+ // 22 -> 23 Added user_entered
+ private static final int DATABASE_VERSION = 23;
// Regular expression which matches http://, followed by some stuff, followed by
// optionally a trailing slash, all matched as separate groups.
"bookmark INTEGER," +
"favicon BLOB DEFAULT NULL," +
"thumbnail BLOB DEFAULT NULL," +
- "touch_icon BLOB DEFAULT NULL" +
+ "touch_icon BLOB DEFAULT NULL," +
+ "user_entered INTEGER" +
");");
final CharSequence[] bookmarks = mContext.getResources()
if (oldVersion < 22) {
db.execSQL("DELETE FROM bookmarks WHERE (bookmark = 0 AND url LIKE \"%.google.%client=ms-%\")");
removeGears();
+ }
+ if (oldVersion < 23) {
+ db.execSQL("ALTER TABLE bookmarks ADD COLUMN user_entered INTEGER;");
} else {
db.execSQL("DROP TABLE IF EXISTS bookmarks");
db.execSQL("DROP TABLE IF EXISTS searches");