summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2009-06-22 06:04:20 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-22 06:04:20 -0700
commitae5b217906397adf6287fc2528cf4b3f59682dec (patch)
tree4d8739cc0d2a446ff449377a5ffef06368dfbec3 /src/com
parent7f1772aa435fa02909b76a5ff50e1084d7cb16a1 (diff)
parentd8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f (diff)
downloadpackages_apps_Browser-ae5b217906397adf6287fc2528cf4b3f59682dec.zip
packages_apps_Browser-ae5b217906397adf6287fc2528cf4b3f59682dec.tar.gz
packages_apps_Browser-ae5b217906397adf6287fc2528cf4b3f59682dec.tar.bz2
am d8b0ad28: Use SearchManager.getSuggestions() non-statically.
Merge commit 'd8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f' * commit 'd8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f': Use SearchManager.getSuggestions() non-statically.
Diffstat (limited to 'src/com')
-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 a3f249b..cf3ed08 100644
--- a/src/com/android/browser/BrowserProvider.java
+++ b/src/com/android/browser/BrowserProvider.java
@@ -152,6 +152,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.
@@ -275,6 +277,7 @@ public class BrowserProvider extends ContentProvider {
ed.commit();
}
}
+ mSearchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
mShowWebSuggestionsSettingChangeObserver
= new ShowWebSuggestionsSettingChangeObserver();
context.getContentResolver().registerContentObserver(
@@ -328,7 +331,7 @@ public class BrowserProvider extends ContentProvider {
ComponentName googleSearchComponent =
new ComponentName(info.activityInfo.packageName,
info.activityInfo.name);
- mSearchableInfo = SearchManager.getSearchableInfo(
+ mSearchableInfo = mSearchManager.getSearchableInfo(
googleSearchComponent, false);
}
}
@@ -669,8 +672,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]);