Fields Summary |
---|
private static final boolean | DBG |
private static final String | TAG |
public static final char | MENU_KEYThis is a shortcut definition for the default menu key to use for invoking search.
See Menu.Item.setAlphabeticShortcut() for more information. |
public static final int | MENU_KEYCODEThis is a shortcut definition for the default menu key to use for invoking search.
See Menu.Item.setAlphabeticShortcut() for more information. |
public static final String | QUERYIntent extra data key: Use this key with
{@link android.content.Intent#getStringExtra
content.Intent.getStringExtra()}
to obtain the query string from Intent.ACTION_SEARCH. |
public static final String | USER_QUERYIntent extra data key: Use this key with
{@link android.content.Intent#getStringExtra
content.Intent.getStringExtra()}
to obtain the query string typed in by the user.
This may be different from the value of {@link #QUERY}
if the intent is the result of selecting a suggestion.
In that case, {@link #QUERY} will contain the value of
{@link #SUGGEST_COLUMN_QUERY} for the suggestion, and
{@link #USER_QUERY} will contain the string typed by the
user. |
public static final String | APP_DATAIntent extra data key: Use this key with Intent.ACTION_SEARCH and
{@link android.content.Intent#getBundleExtra
content.Intent.getBundleExtra()}
to obtain any additional app-specific data that was inserted by the
activity that launched the search. |
public static final String | SEARCH_MODEIntent extra data key: Use {@link android.content.Intent#getBundleExtra
content.Intent.getBundleExtra(SEARCH_MODE)} to get the search mode used
to launch the intent.
The only current value for this is {@link #MODE_GLOBAL_SEARCH_SUGGESTION}. |
public static final String | ACTION_KEYIntent extra data key: Use this key with Intent.ACTION_SEARCH and
{@link android.content.Intent#getIntExtra content.Intent.getIntExtra()}
to obtain the keycode that the user used to trigger this query. It will be zero if the
user simply pressed the "GO" button on the search UI. This is primarily used in conjunction
with the keycode attribute in the actionkey element of your searchable.xml configuration
file. |
public static final String | EXTRA_DATA_KEYIntent extra data key: This key will be used for the extra populated by the
{@link #SUGGEST_COLUMN_INTENT_EXTRA_DATA} column. |
public static final String | EXTRA_SELECT_QUERYBoolean extra data key for {@link #INTENT_ACTION_GLOBAL_SEARCH} intents. If {@code true},
the initial query should be selected when the global search activity is started, so
that the user can easily replace it with another query. |
public static final String | EXTRA_NEW_SEARCHBoolean extra data key for {@link Intent#ACTION_WEB_SEARCH} intents. If {@code true},
this search should open a new browser window, rather than using an existing one. |
public static final String | EXTRA_WEB_SEARCH_PENDINGINTENTExtra data key for {@link Intent#ACTION_WEB_SEARCH}. If set, the value must be a
{@link PendingIntent}. The search activity handling the {@link Intent#ACTION_WEB_SEARCH}
intent will fill in and launch the pending intent. The data URI will be filled in with an
http or https URI, and {@link android.provider.Browser#EXTRA_HEADERS} may be filled in. |
public static final String | CURSOR_EXTRA_KEY_IN_PROGRESSBoolean extra data key for a suggestion provider to return in {@link Cursor#getExtras} to
indicate that the search is not complete yet. This can be used by the search UI
to indicate that a search is in progress. The suggestion provider can return partial results
this way and send a change notification on the cursor when more results are available. |
public static final String | ACTION_MSGIntent extra data key: Use this key with Intent.ACTION_SEARCH and
{@link android.content.Intent#getStringExtra content.Intent.getStringExtra()}
to obtain the action message that was defined for a particular search action key and/or
suggestion. It will be null if the search was launched by typing "enter", touched the the
"GO" button, or other means not involving any action key. |
public static final int | FLAG_QUERY_REFINEMENTFlag to specify that the entry can be used for query refinement, i.e., the query text
in the search field can be replaced with the text in this entry, when a query refinement
icon is clicked. The suggestion list should show such a clickable icon beside the entry.
Use this flag as a bit-field for {@link #SUGGEST_COLUMN_FLAGS}. |
public static final String | SUGGEST_URI_PATH_QUERYUri path for queried suggestions data. This is the path that the search manager
will use when querying your content provider for suggestions data based on user input
(e.g. looking for partial matches).
Typically you'll use this with a URI matcher. |
public static final String | SUGGEST_MIME_TYPEMIME type for suggestions data. You'll use this in your suggestions content provider
in the getType() function. |
public static final String | SUGGEST_URI_PATH_SHORTCUTUri path for shortcut validation. This is the path that the search manager will use when
querying your content provider to refresh a shortcutted suggestion result and to check if it
is still valid. When asked, a source may return an up to date result, or no result. No
result indicates the shortcut refers to a no longer valid sugggestion. |
public static final String | SHORTCUT_MIME_TYPEMIME type for shortcut validation. You'll use this in your suggestions content provider
in the getType() function. |
public static final String | SUGGEST_COLUMN_FORMATColumn name for suggestions cursor. Unused - can be null or column can be omitted. |
public static final String | SUGGEST_COLUMN_TEXT_1Column name for suggestions cursor. Required. This is the primary line of text that
will be presented to the user as the suggestion. |
public static final String | SUGGEST_COLUMN_TEXT_2Column name for suggestions cursor. Optional. If your cursor includes this column,
then all suggestions will be provided in a two-line format. The second line of text is in
a much smaller appearance. |
public static final String | SUGGEST_COLUMN_TEXT_2_URLColumn name for suggestions cursor. Optional. This is a URL that will be shown
as the second line of text instead of {@link #SUGGEST_COLUMN_TEXT_2}. This is a separate
column so that the search UI knows to display the text as a URL, e.g. by using a different
color. If this column is absent, or has the value {@code null},
{@link #SUGGEST_COLUMN_TEXT_2} will be used instead. |
public static final String | SUGGEST_COLUMN_ICON_1Column name for suggestions cursor. Optional. If your cursor includes this column,
then all suggestions will be provided in a format that includes space for two small icons,
one at the left and one at the right of each suggestion. The data in the column must
be a resource ID of a drawable, or a URI in one of the following formats:
- content ({@link android.content.ContentResolver#SCHEME_CONTENT})
- android.resource ({@link android.content.ContentResolver#SCHEME_ANDROID_RESOURCE})
- file ({@link android.content.ContentResolver#SCHEME_FILE})
See {@link android.content.ContentResolver#openAssetFileDescriptor(Uri, String)}
for more information on these schemes. |
public static final String | SUGGEST_COLUMN_ICON_2Column name for suggestions cursor. Optional. If your cursor includes this column,
then all suggestions will be provided in a format that includes space for two small icons,
one at the left and one at the right of each suggestion. The data in the column must
be a resource ID of a drawable, or a URI in one of the following formats:
- content ({@link android.content.ContentResolver#SCHEME_CONTENT})
- android.resource ({@link android.content.ContentResolver#SCHEME_ANDROID_RESOURCE})
- file ({@link android.content.ContentResolver#SCHEME_FILE})
See {@link android.content.ContentResolver#openAssetFileDescriptor(Uri, String)}
for more information on these schemes. |
public static final String | SUGGEST_COLUMN_RESULT_CARD_IMAGEColumn name for suggestions cursor. Optional. If your cursor includes this column,
then the image will be displayed when forming the suggestion. The suggested dimension for
the image is 270x400 px for portrait mode and 400x225 px for landscape mode. The data in the
column must be a resource ID of a drawable, or a URI in one of the following formats:
- content ({@link android.content.ContentResolver#SCHEME_CONTENT})
- android.resource ({@link android.content.ContentResolver#SCHEME_ANDROID_RESOURCE})
- file ({@link android.content.ContentResolver#SCHEME_FILE})
See {@link android.content.ContentResolver#openAssetFileDescriptor(Uri, String)}
for more information on these schemes. |
public static final String | SUGGEST_COLUMN_INTENT_ACTIONColumn name for suggestions cursor. Optional. If this column exists and
this element exists at the given row, this is the action that will be used when
forming the suggestion's intent. If the element is not provided, the action will be taken
from the android:searchSuggestIntentAction field in your XML metadata. At least one of
these must be present for the suggestion to generate an intent. Note: If your action is
the same for all suggestions, it is more efficient to specify it using XML metadata and omit
it from the cursor. |
public static final String | SUGGEST_COLUMN_INTENT_DATAColumn name for suggestions cursor. Optional. If this column exists and
this element exists at the given row, this is the data that will be used when
forming the suggestion's intent. If the element is not provided, the data will be taken
from the android:searchSuggestIntentData field in your XML metadata. If neither source
is provided, the Intent's data field will be null. Note: If your data is
the same for all suggestions, or can be described using a constant part and a specific ID,
it is more efficient to specify it using XML metadata and omit it from the cursor. |
public static final String | SUGGEST_COLUMN_INTENT_EXTRA_DATAColumn name for suggestions cursor. Optional. If this column exists and
this element exists at the given row, this is the data that will be used when
forming the suggestion's intent. If not provided, the Intent's extra data field will be null.
This column allows suggestions to provide additional arbitrary data which will be included as
an extra under the key {@link #EXTRA_DATA_KEY}. |
public static final String | SUGGEST_COLUMN_INTENT_DATA_IDColumn name for suggestions cursor. Optional. If this column exists and
this element exists at the given row, then "/" and this value will be appended to the data
field in the Intent. This should only be used if the data field has already been set to an
appropriate base string. |
public static final String | SUGGEST_COLUMN_QUERYColumn name for suggestions cursor. Required if action is
{@link android.content.Intent#ACTION_SEARCH ACTION_SEARCH}, optional otherwise. If this
column exists and this element exists at the given row, this is the data that will be
used when forming the suggestion's query. |
public static final String | SUGGEST_COLUMN_SHORTCUT_IDColumn name for suggestions cursor. Optional. This column is used to indicate whether
a search suggestion should be stored as a shortcut, and whether it should be refreshed. If
missing, the result will be stored as a shortcut and never validated. If set to
{@link #SUGGEST_NEVER_MAKE_SHORTCUT}, the result will not be stored as a shortcut.
Otherwise, the shortcut id will be used to check back for an up to date suggestion using
{@link #SUGGEST_URI_PATH_SHORTCUT}. |
public static final String | SUGGEST_COLUMN_SPINNER_WHILE_REFRESHINGColumn name for suggestions cursor. Optional. This column is used to specify
that a spinner should be shown in lieu of an icon2 while the shortcut of this suggestion
is being refreshed. |
public static final String | SUGGEST_COLUMN_CONTENT_TYPEColumn name for suggestions cursor. Optional. If your content is media type, you
should provide this column so search app could understand more about your content. The data
in the column must specify the MIME type of the content. |
public static final String | SUGGEST_COLUMN_IS_LIVEColumn name for suggestions cursor. Optional. If your content is media type, you
should provide this column to specify whether your content is live media such as live video
or live audio. The value in the column is of integer type with value of either 0 indicating
non-live content or 1 indicating live content. |
public static final String | SUGGEST_COLUMN_VIDEO_WIDTHColumn name for suggestions cursor. Optional. If your content is video, you should
provide this column to specify the number of vertical lines. The data in the column is of
integer type. |
public static final String | SUGGEST_COLUMN_VIDEO_HEIGHTColumn name for suggestions cursor. Optional. If your content is video, you should
provide this column to specify the number of horizontal lines. The data in the column is of
integer type. |
public static final String | SUGGEST_COLUMN_AUDIO_CHANNEL_CONFIGColumn name for suggestions cursor. Optional. If your content contains audio, you
should provide this column to specify the audio channel configuration. The data in the
column is string with format like "channels.subchannels" such as "1.0" or "5.1". |
public static final String | SUGGEST_COLUMN_PURCHASE_PRICEColumn name for suggestions cursor. Optional. If your content is purchasable, you
should provide this column to specify the displayable string representation of the purchase
price of your content including the currency and the amount. If it's free, you should
provide localized string to specify that it's free. This column can be omitted if the content
is not applicable to purchase. |
public static final String | SUGGEST_COLUMN_RENTAL_PRICEColumn name for suggestions cursor. Optional. If your content is rentable, you
should provide this column to specify the displayable string representation of the rental
price of your content including the currency and the amount. If it's free, you should
provide localized string to specify that it's free. This column can be ommitted if the
content is not applicable to rent. |
public static final String | SUGGEST_COLUMN_RATING_STYLEColumn name for suggestions cursor. Optional. If your content has a rating, you
should provide this column to specify the rating style of your content. The data in the
column must be one of the constant values specified in {@link android.media.Rating} |
public static final String | SUGGEST_COLUMN_RATING_SCOREColumn name for suggestions cursor. Optional. If your content has a rating, you
should provide this column to specify the rating score of your content. The data in the
column is of float type. See {@link android.media.Rating} about valid rating scores for each
rating style. |
public static final String | SUGGEST_COLUMN_PRODUCTION_YEARColumn name for suggestions cursor. Optional. If your content is video or audio and
has a known production year, you should provide this column to specify the production year
of your content. The data in the column is of integer type. |
public static final String | SUGGEST_COLUMN_DURATIONColumn name for suggestions cursor. Optional. If your content is video or audio, you
should provide this column to specify the duration of your content in milliseconds. The data
in the column is of long type. |
public static final String | SUGGEST_COLUMN_FLAGSColumn name for suggestions cursor. Optional. This column is used to specify
additional flags per item. Multiple flags can be specified.
Must be one of {@link #FLAG_QUERY_REFINEMENT} or 0 to indicate no flags.
|
public static final String | SUGGEST_COLUMN_LAST_ACCESS_HINTColumn name for suggestions cursor. Optional. This column may be
used to specify the time in {@link System#currentTimeMillis
System.currentTImeMillis()} (wall time in UTC) when an item was last
accessed within the results-providing application. If set, this may be
used to show more-recently-used items first. |
public static final String | SUGGEST_NEVER_MAKE_SHORTCUTColumn value for suggestion column {@link #SUGGEST_COLUMN_SHORTCUT_ID} when a suggestion
should not be stored as a shortcut in global search. |
public static final String | SUGGEST_PARAMETER_LIMITQuery parameter added to suggestion queries to limit the number of suggestions returned.
This limit is only advisory and suggestion providers may chose to ignore it. |
public static final String | INTENT_ACTION_GLOBAL_SEARCHIntent action for starting the global search activity.
The global search provider should handle this intent.
Supported extra data keys: {@link #QUERY},
{@link #EXTRA_SELECT_QUERY},
{@link #APP_DATA}. |
public static final String | INTENT_ACTION_SEARCH_SETTINGSIntent action for starting the global search settings activity.
The global search provider should handle this intent. |
public static final String | INTENT_ACTION_WEB_SEARCH_SETTINGSIntent action for starting a web search provider's settings activity.
Web search providers should handle this intent if they have provider-specific
settings to implement. |
public static final String | INTENT_ACTION_SEARCHABLES_CHANGEDIntent action broadcasted to inform that the searchables list or default have changed.
Components should handle this intent if they cache any searchable data and wish to stay
up to date on changes. |
public static final String | INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGEDIntent action to be broadcast to inform that the global search provider
has changed. |
public static final String | INTENT_ACTION_SEARCH_SETTINGS_CHANGEDIntent action broadcasted to inform that the search settings have changed in some way.
Either searchables have been enabled or disabled, or a different web search provider
has been chosen. |
public static final String | CONTEXT_IS_VOICEThis means that context is voice, and therefore the SearchDialog should
continue showing the microphone until the user indicates that he/she does
not want to re-speak (e.g. by typing). |
public static final String | DISABLE_VOICE_SEARCHThis means that the voice icon should not be shown at all, because the
current search engine does not support voice search. |
private static ISearchManager | mServiceReference to the shared system search service. |
private final android.content.Context | mContext |
private String | mAssociatedPackageThe package associated with this seach manager. |
final android.os.Handler | mHandler |
OnDismissListener | mDismissListener |
OnCancelListener | mCancelListener |
private SearchDialog | mSearchDialog |
Methods Summary |
---|
private void | ensureSearchDialog()
if (mSearchDialog == null) {
mSearchDialog = new SearchDialog(mContext, this);
mSearchDialog.setOnCancelListener(this);
mSearchDialog.setOnDismissListener(this);
}
|
public android.content.Intent | getAssistIntent(android.content.Context context, boolean inclContext)Gets an intent for launching installed assistant activity, or null if not available.
return getAssistIntent(context, inclContext, UserHandle.myUserId());
|
public android.content.Intent | getAssistIntent(android.content.Context context, boolean inclContext, int userHandle)Gets an intent for launching installed assistant activity, or null if not available.
try {
if (mService == null) {
return null;
}
ComponentName comp = mService.getAssistIntent(userHandle);
if (comp == null) {
return null;
}
Intent intent = new Intent(Intent.ACTION_ASSIST);
intent.setComponent(comp);
if (inclContext) {
IActivityManager am = ActivityManagerNative.getDefault();
Bundle extras = am.getAssistContextExtras(0);
if (extras != null) {
intent.replaceExtras(extras);
}
}
return intent;
} catch (RemoteException re) {
Log.e(TAG, "getAssistIntent() failed: " + re);
return null;
}
|
public java.util.List | getGlobalSearchActivities()Returns a list of installed apps that handle the global search
intent.
try {
return mService.getGlobalSearchActivities();
} catch (RemoteException ex) {
Log.e(TAG, "getGlobalSearchActivities() failed: " + ex);
return null;
}
|
public android.content.ComponentName | getGlobalSearchActivity()Gets the name of the global search activity.
try {
return mService.getGlobalSearchActivity();
} catch (RemoteException ex) {
Log.e(TAG, "getGlobalSearchActivity() failed: " + ex);
return null;
}
|
public SearchableInfo | getSearchableInfo(android.content.ComponentName componentName)Gets information about a searchable activity.
try {
return mService.getSearchableInfo(componentName);
} catch (RemoteException ex) {
Log.e(TAG, "getSearchableInfo() failed: " + ex);
return null;
}
|
public java.util.List | getSearchablesInGlobalSearch()Returns a list of the searchable activities that can be included in global search.
try {
return mService.getSearchablesInGlobalSearch();
} catch (RemoteException e) {
Log.e(TAG, "getSearchablesInGlobalSearch() failed: " + e);
return null;
}
|
public android.database.Cursor | getSuggestions(SearchableInfo searchable, java.lang.String query)Gets a cursor with search suggestions.
return getSuggestions(searchable, query, -1);
|
public android.database.Cursor | getSuggestions(SearchableInfo searchable, java.lang.String query, int limit)Gets a cursor with search suggestions.
if (searchable == null) {
return null;
}
String authority = searchable.getSuggestAuthority();
if (authority == null) {
return null;
}
Uri.Builder uriBuilder = new Uri.Builder()
.scheme(ContentResolver.SCHEME_CONTENT)
.authority(authority)
.query("") // TODO: Remove, workaround for a bug in Uri.writeToParcel()
.fragment(""); // TODO: Remove, workaround for a bug in Uri.writeToParcel()
// if content path provided, insert it now
final String contentPath = searchable.getSuggestPath();
if (contentPath != null) {
uriBuilder.appendEncodedPath(contentPath);
}
// append standard suggestion query path
uriBuilder.appendPath(SearchManager.SUGGEST_URI_PATH_QUERY);
// get the query selection, may be null
String selection = searchable.getSuggestSelection();
// inject query, either as selection args or inline
String[] selArgs = null;
if (selection != null) { // use selection if provided
selArgs = new String[] { query };
} else { // no selection, use REST pattern
uriBuilder.appendPath(query);
}
if (limit > 0) {
uriBuilder.appendQueryParameter(SUGGEST_PARAMETER_LIMIT, String.valueOf(limit));
}
Uri uri = uriBuilder.build();
// finally, make the query
return mContext.getContentResolver().query(uri, null, selection, selArgs, null);
|
public android.content.ComponentName | getWebSearchActivity()Gets the name of the web search activity.
try {
return mService.getWebSearchActivity();
} catch (RemoteException ex) {
Log.e(TAG, "getWebSearchActivity() failed: " + ex);
return null;
}
|
public boolean | isVisible()Determine if the Search UI is currently displayed.
This is provided primarily for application test purposes.
return mSearchDialog == null? false : mSearchDialog.isShowing();
|
public boolean | launchAssistAction(int requestType, java.lang.String hint, int userHandle)Launch an assist action for the current top activity.
try {
if (mService == null) {
return false;
}
return mService.launchAssistAction(requestType, hint, userHandle);
} catch (RemoteException re) {
Log.e(TAG, "launchAssistAction() failed: " + re);
return false;
}
|
public void | onCancel(android.content.DialogInterface dialog)
if (mCancelListener != null) {
mCancelListener.onCancel();
}
|
public void | onDismiss(android.content.DialogInterface dialog)
if (mDismissListener != null) {
mDismissListener.onDismiss();
}
|
public void | setOnCancelListener(android.app.SearchManager$OnCancelListener listener)Set or clear the callback that will be invoked whenever the search UI is canceled.
mCancelListener = listener;
|
public void | setOnDismissListener(android.app.SearchManager$OnDismissListener listener)Set or clear the callback that will be invoked whenever the search UI is dismissed.
mDismissListener = listener;
|
void | startGlobalSearch(java.lang.String initialQuery, boolean selectInitialQuery, android.os.Bundle appSearchData, android.graphics.Rect sourceBounds)Starts the global search activity.
ComponentName globalSearchActivity = getGlobalSearchActivity();
if (globalSearchActivity == null) {
Log.w(TAG, "No global search activity found.");
return;
}
Intent intent = new Intent(INTENT_ACTION_GLOBAL_SEARCH);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(globalSearchActivity);
// Make sure that we have a Bundle to put source in
if (appSearchData == null) {
appSearchData = new Bundle();
} else {
appSearchData = new Bundle(appSearchData);
}
// Set source to package name of app that starts global search, if not set already.
if (!appSearchData.containsKey("source")) {
appSearchData.putString("source", mContext.getPackageName());
}
intent.putExtra(APP_DATA, appSearchData);
if (!TextUtils.isEmpty(initialQuery)) {
intent.putExtra(QUERY, initialQuery);
}
if (selectInitialQuery) {
intent.putExtra(EXTRA_SELECT_QUERY, selectInitialQuery);
}
intent.setSourceBounds(sourceBounds);
try {
if (DBG) Log.d(TAG, "Starting global search: " + intent.toUri(0));
mContext.startActivity(intent);
} catch (ActivityNotFoundException ex) {
Log.e(TAG, "Global search activity not found: " + globalSearchActivity);
}
|
public void | startSearch(java.lang.String initialQuery, boolean selectInitialQuery, android.content.ComponentName launchActivity, android.os.Bundle appSearchData, boolean globalSearch)Launch search UI.
The search manager will open a search widget in an overlapping
window, and the underlying activity may be obscured. The search
entry state will remain in effect until one of the following events:
- The user completes the search. In most cases this will launch
a search intent.
- The user uses the back, home, or other keys to exit the search.
- The application calls the {@link #stopSearch}
method, which will hide the search window and return focus to the
activity from which it was launched.
Most applications will not use this interface to invoke search.
The primary method for invoking search is to call
{@link android.app.Activity#onSearchRequested Activity.onSearchRequested()} or
{@link android.app.Activity#startSearch Activity.startSearch()}.
startSearch(initialQuery, selectInitialQuery, launchActivity,
appSearchData, globalSearch, null);
|
public void | startSearch(java.lang.String initialQuery, boolean selectInitialQuery, android.content.ComponentName launchActivity, android.os.Bundle appSearchData, boolean globalSearch, android.graphics.Rect sourceBounds)As {@link #startSearch(String, boolean, ComponentName, Bundle, boolean)} but including
source bounds for the global search intent.
if (globalSearch) {
startGlobalSearch(initialQuery, selectInitialQuery, appSearchData, sourceBounds);
return;
}
UiModeManager uiModeManager = new UiModeManager();
// Don't show search dialog on televisions.
if (uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_TELEVISION) {
ensureSearchDialog();
mSearchDialog.show(initialQuery, selectInitialQuery, launchActivity, appSearchData);
}
|
public void | stopSearch()Terminate search UI.
Typically the user will terminate the search UI by launching a
search or by canceling. This function allows the underlying application
or activity to cancel the search prematurely (for any reason).
This function can be safely called at any time (even if no search is active.)
if (mSearchDialog != null) {
mSearchDialog.cancel();
}
|
public void | triggerSearch(java.lang.String query, android.content.ComponentName launchActivity, android.os.Bundle appSearchData)Similar to {@link #startSearch} but actually fires off the search query after invoking
the search dialog. Made available for testing purposes.
if (!mAssociatedPackage.equals(launchActivity.getPackageName())) {
throw new IllegalArgumentException("invoking app search on a different package " +
"not associated with this search manager");
}
if (query == null || TextUtils.getTrimmedLength(query) == 0) {
Log.w(TAG, "triggerSearch called with empty query, ignoring.");
return;
}
startSearch(query, false, launchActivity, appSearchData, false);
mSearchDialog.launchQuerySearch();
|