From f9b042722667ecb8828be23276a5f8e222850dd8 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Tue, 15 Jun 2010 13:36:22 -0700 Subject: When the string is empty, just return an empty list. Fix http://b/issue?id=2771338 --- src/com/android/browser/BrowserProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/browser/BrowserProvider.java b/src/com/android/browser/BrowserProvider.java index bf1f9d5..1eec52b 100644 --- a/src/com/android/browser/BrowserProvider.java +++ b/src/com/android/browser/BrowserProvider.java @@ -465,7 +465,7 @@ public class BrowserProvider extends ContentProvider { public MySuggestionCursor(Cursor hc, Cursor sc, String string) { mHistoryCursor = hc; mSuggestCursor = sc; - mHistoryCount = hc.getCount(); + mHistoryCount = hc != null ? hc.getCount() : 0; mSuggestionCount = sc != null ? sc.getCount() : 0; if (mSuggestionCount > (MAX_SUGGESTION_LONG_ENTRIES - mHistoryCount)) { mSuggestionCount = MAX_SUGGESTION_LONG_ENTRIES - mHistoryCount; @@ -846,8 +846,7 @@ public class BrowserProvider extends ContentProvider { String suggestSelection; String [] myArgs; if (selectionArgs[0] == null || selectionArgs[0].equals("")) { - suggestSelection = null; - myArgs = null; + return new MySuggestionCursor(null, null, ""); } else { String like = selectionArgs[0] + "%"; if (selectionArgs[0].startsWith("http") -- cgit v1.1