Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 268c7111 authored by Bjorn Bringert's avatar Bjorn Bringert Committed by Android (Google) Code Review
Browse files

Merge "Pass AppData to the app from SearchDialog queries."

parents 4a85a7dc 940ef38c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
        }
+13 −0
Original line number Diff line number Diff line
@@ -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);