summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/SearchManager.java
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2010-02-18 21:57:59 +0000
committerBjorn Bringert <bringert@android.com>2010-02-18 21:57:59 +0000
commitea125f45ebf25494ae190b2f338f359f830674df (patch)
treee3fd1bd25132034566f0774157fc8094db177958 /core/java/android/app/SearchManager.java
parent6f760ee1c232b39a5593dd0a53f0788c6700ee68 (diff)
downloadframeworks_base-ea125f45ebf25494ae190b2f338f359f830674df.zip
frameworks_base-ea125f45ebf25494ae190b2f338f359f830674df.tar.gz
frameworks_base-ea125f45ebf25494ae190b2f338f359f830674df.tar.bz2
Add SearchManager.getWebSearchActivity()
The Browser needs this to know where to get web suggestions from. Change-Id: Ia7ce75609135e7cdf3b385a29a3f47e3458fa61e
Diffstat (limited to 'core/java/android/app/SearchManager.java')
-rw-r--r--core/java/android/app/SearchManager.java19
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.
*