diff options
author | John Reck <jreck@google.com> | 2011-06-27 15:42:39 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-06-27 15:42:39 -0700 |
commit | 7ffb8957966fde0de338f4d42067d0edae295a9e (patch) | |
tree | e8f15f75fcb86006e363e242cd33797c5950a3c3 /src | |
parent | 32feebd05dc90785194df32b7a14c2e0ceba2b1e (diff) | |
download | packages_apps_Browser-7ffb8957966fde0de338f4d42067d0edae295a9e.zip packages_apps_Browser-7ffb8957966fde0de338f4d42067d0edae295a9e.tar.gz packages_apps_Browser-7ffb8957966fde0de338f4d42067d0edae295a9e.tar.bz2 |
Prevent duplicates in omnibox
Change-Id: Idf91591a981543fb84a73d08e3c5bbc2c7d23d6f
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/SuggestionsAdapter.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/provider/BrowserProvider2.java | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/browser/SuggestionsAdapter.java index 242e170..9a099cb 100644 --- a/src/com/android/browser/SuggestionsAdapter.java +++ b/src/com/android/browser/SuggestionsAdapter.java @@ -16,6 +16,7 @@ package com.android.browser; +import com.android.browser.provider.BrowserProvider2; import com.android.browser.search.SearchEngine; import android.app.SearchManager; @@ -472,6 +473,8 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, Uri.Builder ub = BrowserContract.Combined.CONTENT_URI.buildUpon(); ub.appendQueryParameter(BrowserContract.PARAM_LIMIT, Integer.toString(Math.max(mLinesLandscape, mLinesPortrait))); + ub.appendQueryParameter(BrowserProvider2.PARAM_GROUP_BY, + BrowserContract.Combined.URL); mCursor = mContext.getContentResolver().query(ub.build(), COMBINED_PROJECTION, selection, diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index 284d9bc..fabadac 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -80,6 +80,8 @@ public class BrowserProvider2 extends SQLiteContentProvider { public static final String FAVICON = History.FAVICON; } + public static final String PARAM_GROUP_BY = "groupBy"; + public static final String LEGACY_AUTHORITY = "browser"; static final Uri LEGACY_AUTHORITY_URI = new Uri.Builder() .authority(LEGACY_AUTHORITY).scheme("content").build(); @@ -795,6 +797,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { final int match = URI_MATCHER.match(uri); SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); String limit = uri.getQueryParameter(BrowserContract.PARAM_LIMIT); + String groupBy = uri.getQueryParameter(PARAM_GROUP_BY); switch (match) { case ACCOUNTS: { qb.setTables(VIEW_ACCOUNTS); @@ -1023,8 +1026,8 @@ public class BrowserProvider2 extends SQLiteContentProvider { } } - Cursor cursor = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder, - limit); + Cursor cursor = qb.query(db, projection, selection, selectionArgs, groupBy, + null, sortOrder, limit); cursor.setNotificationUri(getContext().getContentResolver(), BrowserContract.AUTHORITY_URI); return cursor; } |