summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-01-23 16:15:06 -0800
committerJohn Reck <jreck@google.com>2012-01-23 16:33:01 -0800
commitf19210b71d399689d7ae271611e7675ae68b5039 (patch)
tree13647b16eb7ea8705c37f9ba1eddca14e3a41d1e /src
parentd2e3593189be9d536e87d5dbecc32e6f5eb8715a (diff)
downloadpackages_apps_Browser-f19210b71d399689d7ae271611e7675ae68b5039.zip
packages_apps_Browser-f19210b71d399689d7ae271611e7675ae68b5039.tar.gz
packages_apps_Browser-f19210b71d399689d7ae271611e7675ae68b5039.tar.bz2
Enforce most visited limit
Change-Id: If24a89703d74d359461c4c4c6c46449fd93d2be5
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/homepages/RequestHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/browser/homepages/RequestHandler.java b/src/com/android/browser/homepages/RequestHandler.java
index 1ae5b3e..b3a03b9 100644
--- a/src/com/android/browser/homepages/RequestHandler.java
+++ b/src/com/android/browser/homepages/RequestHandler.java
@@ -113,8 +113,13 @@ public class RequestHandler extends Thread {
if (cursor.getCount() < 12) {
Cursor bookmarkResults = mContext.getContentResolver().query(
Bookmarks.CONTENT_URI, PROJECTION, SELECTION,
- null, null);
- cursor = new MergeCursor(new Cursor[] { historyResults, bookmarkResults });
+ null, Bookmarks.DATE_CREATED + " DESC LIMIT 12");
+ cursor = new MergeCursor(new Cursor[] { historyResults, bookmarkResults }) {
+ @Override
+ public int getCount() {
+ return Math.min(12, super.getCount());
+ }
+ };
}
t.assignLoop("most_visited", new Template.CursorListEntityWrapper(cursor) {