diff options
Diffstat (limited to 'src/com/android/browser')
-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 724cbad..06e4e4a 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; } |