From 8a1ee129648d871d3720529a0032b0c6b15810a7 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 31 Dec 2012 20:15:03 +0100 Subject: Show search suggestions only when enabled in preferences Change-Id: I6d6cd753f1bdffa6aecd078db62b1bbc08e95aa7 Signed-off-by: Paul Kocialkowski --- res/values/strings.xml | 4 ++++ res/xml/privacy_security_preferences.xml | 6 ++++++ src/com/android/browser/BrowserSettings.java | 4 ++++ src/com/android/browser/PreferenceKeys.java | 1 + src/com/android/browser/SuggestionsAdapter.java | 8 +++++++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index d79c7f7..f5d3d26 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -487,6 +487,10 @@ Show warning if there\'s a problem with a site\'s security + Show search suggestions + + Show search suggestions when typing in the URL field + Accept cookies Allow sites to save and read cookie data diff --git a/res/xml/privacy_security_preferences.xml b/res/xml/privacy_security_preferences.xml index 2633600..a574e61 100644 --- a/res/xml/privacy_security_preferences.xml +++ b/res/xml/privacy_security_preferences.xml @@ -37,6 +37,12 @@ android:title="@string/pref_security_show_security_warning" android:summary="@string/pref_security_show_security_warning_summary" /> + + doInBackground(CharSequence... params) { + List results = new ArrayList(); + + // Don't query the search engine if disabled in settings + if (!mSettings.showSearchSuggestions()) { + return results; + } + SuggestCursor cursor = new SuggestCursor(); cursor.runQuery(params[0]); - List results = new ArrayList(); int count = cursor.getCount(); for (int i = 0; i < count; i++) { results.add(cursor.getItem()); -- cgit v1.1