summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/browser/BookmarkUtils.java17
-rw-r--r--src/com/android/browser/SuggestionsAdapter.java2
2 files changed, 13 insertions, 6 deletions
diff --git a/src/com/android/browser/BookmarkUtils.java b/src/com/android/browser/BookmarkUtils.java
index c72cbd1..58622ce 100644
--- a/src/com/android/browser/BookmarkUtils.java
+++ b/src/com/android/browser/BookmarkUtils.java
@@ -170,16 +170,21 @@ class BookmarkUtils {
}
/* package */ static Uri getBookmarksUri(Context context) {
+ return addAccountInfo(context,
+ BrowserContract.Bookmarks.CONTENT_URI.buildUpon()).build();
+ }
+
+ /* package */ static Uri.Builder addAccountInfo(Context context, Uri.Builder ub) {
Uri uri = BrowserContract.Bookmarks.CONTENT_URI;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String accountType = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_TYPE, null);
String accountName = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_NAME, null);
if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) {
- uri = uri.buildUpon()
- .appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME, accountName)
- .appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType)
- .build();
+ ub.appendQueryParameter(
+ BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME,accountName);
+ ub.appendQueryParameter(
+ BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType);
}
- return uri;
+ return ub;
}
-};
+}
diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/browser/SuggestionsAdapter.java
index 8c06353..6473dfd 100644
--- a/src/com/android/browser/SuggestionsAdapter.java
+++ b/src/com/android/browser/SuggestionsAdapter.java
@@ -498,10 +498,12 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli
Uri.Builder ub = BrowserContract.Combined.CONTENT_URI.buildUpon();
ub.appendQueryParameter(BrowserContract.PARAM_LIMIT,
Integer.toString(mLinesPortrait));
+ BookmarkUtils.addAccountInfo(mContext, ub);
mCursor =
mContext.getContentResolver().query(ub.build(), COMBINED_PROJECTION,
selection,
(constraint != null) ? args : null,
+ BrowserContract.Combined.IS_BOOKMARK + " DESC, " +
BrowserContract.Combined.VISITS + " DESC, " +
BrowserContract.Combined.DATE_LAST_VISITED + " DESC");
if (mCursor != null) {