diff options
author | Grace Kloba <klobag@google.com> | 2010-06-15 13:36:22 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2010-06-15 13:36:22 -0700 |
commit | f9b042722667ecb8828be23276a5f8e222850dd8 (patch) | |
tree | a881f92ed3281fe29de0ee52a4d9cab18356ceaf /src | |
parent | 11bd45d76c27dd02646669ca117e9b3ca7afe244 (diff) | |
download | packages_apps_Browser-f9b042722667ecb8828be23276a5f8e222850dd8.zip packages_apps_Browser-f9b042722667ecb8828be23276a5f8e222850dd8.tar.gz packages_apps_Browser-f9b042722667ecb8828be23276a5f8e222850dd8.tar.bz2 |
When the string is empty, just return an empty list.
Fix http://b/issue?id=2771338
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/BrowserProvider.java | 5 |
1 files changed, 2 insertions, 3 deletions
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") |