diff options
author | Amith Yamasani <yamasani@google.com> | 2011-03-02 18:43:23 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-03-02 18:43:23 -0800 |
commit | 940ef38c7c46565a8f8fdd6bb8e0183646d0abdc (patch) | |
tree | 4d1da209abae8eaf5ae19838d0e2fb5ab5e1a76a /core | |
parent | 0528bc77948e49bd75cfd4082fb8fef3a7238626 (diff) | |
download | frameworks_base-940ef38c7c46565a8f8fdd6bb8e0183646d0abdc.zip frameworks_base-940ef38c7c46565a8f8fdd6bb8e0183646d0abdc.tar.gz frameworks_base-940ef38c7c46565a8f8fdd6bb8e0183646d0abdc.tar.bz2 |
Pass AppData to the app from SearchDialog queries.
Bug: 3494468
During migration of SearchDialog to use SearchView, the appdata was not
passed along. This fixes the loss.
Change-Id: Ia754086d2bb95294e1d29650a72e4fdddec9c899
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/SearchDialog.java | 1 | ||||
-rw-r--r-- | core/java/android/widget/SearchView.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index e95a23d..db8d5e9 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -255,6 +255,7 @@ public class SearchDialog extends Dialog { // of any bad state in the AutoCompleteTextView etc createContentView(); mSearchView.setSearchableInfo(mSearchable); + mSearchView.setAppSearchData(mAppSearchData); show(); } diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java index 22edcd0..2d164fd 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -96,6 +96,7 @@ public class SearchView extends LinearLayout { private boolean mVoiceButtonEnabled; private SearchableInfo mSearchable; + private Bundle mAppSearchData; // For voice searching private final Intent mVoiceWebSearchIntent; @@ -263,6 +264,15 @@ public class SearchView extends LinearLayout { updateViewsVisibility(mIconifiedByDefault); } + /** + * Sets the APP_DATA for legacy SearchDialog use. + * @param appSearchData bundle provided by the app when launching the search dialog + * @hide + */ + public void setAppSearchData(Bundle appSearchData) { + mAppSearchData = appSearchData; + } + /** @hide */ @Override public boolean requestFocus(int direction, Rect previouslyFocusedRect) { @@ -1115,6 +1125,9 @@ public class SearchView extends LinearLayout { if (extraData != null) { intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData); } + if (mAppSearchData != null) { + intent.putExtra(SearchManager.APP_DATA, mAppSearchData); + } if (actionKey != KeyEvent.KEYCODE_UNKNOWN) { intent.putExtra(SearchManager.ACTION_KEY, actionKey); intent.putExtra(SearchManager.ACTION_MSG, actionMsg); |