summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserProvider.java
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2009-06-22 10:36:29 +0100
committerBjorn Bringert <bringert@android.com>2009-06-22 12:19:34 +0100
commitd8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f (patch)
treeafa1057fa3ab83135b8bdc02a89e3eaf70da1651 /src/com/android/browser/BrowserProvider.java
parente95ab20ea57d3df60aa38d7e147334cc44c484c3 (diff)
downloadpackages_apps_browser-d8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f.zip
packages_apps_browser-d8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f.tar.gz
packages_apps_browser-d8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f.tar.bz2
Use SearchManager.getSuggestions() non-statically.
Diffstat (limited to 'src/com/android/browser/BrowserProvider.java')
-rw-r--r--src/com/android/browser/BrowserProvider.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/browser/BrowserProvider.java b/src/com/android/browser/BrowserProvider.java
index c97c057..9b72364 100644
--- a/src/com/android/browser/BrowserProvider.java
+++ b/src/com/android/browser/BrowserProvider.java
@@ -149,6 +149,8 @@ public class BrowserProvider extends ContentProvider {
// optionally a trailing slash, all matched as separate groups.
private static final Pattern STRIP_URL_PATTERN = Pattern.compile("^(http://)(.*?)(/$)?");
+ private SearchManager mSearchManager;
+
// The hex color string to be applied to urls of website suggestions, as derived from
// the current theme. This is not set until/unless beautifyUrl is called, at which point
// this variable caches the color value.
@@ -268,6 +270,7 @@ public class BrowserProvider extends ContentProvider {
ed.commit();
}
}
+ mSearchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
mShowWebSuggestionsSettingChangeObserver
= new ShowWebSuggestionsSettingChangeObserver();
context.getContentResolver().registerContentObserver(
@@ -321,7 +324,7 @@ public class BrowserProvider extends ContentProvider {
ComponentName googleSearchComponent =
new ComponentName(info.activityInfo.packageName,
info.activityInfo.name);
- mSearchableInfo = SearchManager.getSearchableInfo(
+ mSearchableInfo = mSearchManager.getSearchableInfo(
googleSearchComponent, false);
}
}
@@ -662,8 +665,7 @@ public class BrowserProvider extends ContentProvider {
if (myArgs != null && myArgs.length > 1
&& mSearchableInfo != null
&& c.getCount() < (MAX_SUGGESTION_SHORT_ENTRIES - 1)) {
- Cursor sc = SearchManager.getSuggestions(
- getContext(), mSearchableInfo, selectionArgs[0]);
+ Cursor sc = mSearchManager.getSuggestions(mSearchableInfo, selectionArgs[0]);
return new MySuggestionCursor(c, sc, selectionArgs[0]);
}
return new MySuggestionCursor(c, null, selectionArgs[0]);