diff options
author | Bjorn Bringert <bringert@android.com> | 2010-02-18 14:25:33 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-18 14:25:33 -0800 |
commit | 2640b6315919619e3be30e7cc821856b83d989fd (patch) | |
tree | 8723766eeb3e9f7fda27788c7efbeea453ba040c /core/java/android | |
parent | c34ebce475a6994f1aa59b8c535ff966c8f59431 (diff) | |
parent | ea125f45ebf25494ae190b2f338f359f830674df (diff) | |
download | frameworks_base-2640b6315919619e3be30e7cc821856b83d989fd.zip frameworks_base-2640b6315919619e3be30e7cc821856b83d989fd.tar.gz frameworks_base-2640b6315919619e3be30e7cc821856b83d989fd.tar.bz2 |
Merge "Add SearchManager.getWebSearchActivity()"
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/SearchManager.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java index 52cdc74..ce5f1bf 100644 --- a/core/java/android/app/SearchManager.java +++ b/core/java/android/app/SearchManager.java @@ -1690,6 +1690,25 @@ public class SearchManager } /** + * Gets the name of the web search activity. + * + * @return The name of the default activity for web searches. This activity + * can be used to get web search suggestions. Returns {@code null} if + * there is no default web search activity. + * + * @hide + */ + public ComponentName getWebSearchActivity() { + ComponentName globalSearch = getGlobalSearchActivity(); + if (globalSearch == null) { + return null; + } + Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); + intent.setPackage(globalSearch.getPackageName()); + return intent.resolveActivity(mContext.getPackageManager()); + } + + /** * Similar to {@link #startSearch} but actually fires off the search query after invoking * the search dialog. Made available for testing purposes. * |