Skip to content

Commit 1bcfe84

Browse files
author
Jorge Ruesga
committed
SearchWidget: passing APP_DATA to voice intent
SearchView uses SearchManager.APP_DATA to pass data between the origin activity and the search activity. This works for text searches (keyboard), but it's not implemented by voice recognition searches. The method createVoiceAppSearchIntent initializes a empty bundle that is filled with the QUERY parameter. This patch adds the SearchManager.APP_DATA parameter if is present, let the search activity access to the data passed by the origin activity Patch 2: Fix code style Change-Id: I52dce34e1efd07a30ad74d52bfc60fbae1c4310b
1 parent 0dab1a1 commit 1bcfe84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/java/android/widget/SearchView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,9 @@ private Intent createVoiceAppSearchIntent(Intent baseIntent, SearchableInfo sear
15061506
// because the voice search activity will always need to insert "QUERY" into
15071507
// it anyway.
15081508
Bundle queryExtras = new Bundle();
1509+
if (mAppSearchData != null) {
1510+
queryExtras.putParcelable(SearchManager.APP_DATA, mAppSearchData);
1511+
}
15091512

15101513
// Now build the intent to launch the voice search. Add all necessary
15111514
// extras to launch the voice recognizer, and then all the necessary extras

0 commit comments

Comments
 (0)